Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
4f6b1c14
Commit
4f6b1c14
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Move Utils_ArraysTest to SimpleSAML\Test\Utils\ArraysTest.
parent
143e57b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lib/SimpleSAML/Utils/ArraysTest.php
+14
-11
14 additions, 11 deletions
tests/lib/SimpleSAML/Utils/ArraysTest.php
with
14 additions
and
11 deletions
tests/lib/SimpleSAML/Utils/ArraysTest.php
+
14
−
11
View file @
4f6b1c14
<?php
namespace
SimpleSAML\Test\Utils
;
use
SimpleSAML\Utils\Arrays
;
/**
* Tests for SimpleSAML\Utils\Arrays.
*/
class
Utils_
ArraysTest
extends
PHPUnit_Framework_TestCase
class
ArraysTest
extends
\
PHPUnit_Framework_TestCase
{
/**
...
...
@@ -14,23 +17,23 @@ class Utils_ArraysTest extends PHPUnit_Framework_TestCase
{
// check with empty array as input
$array
=
array
();
$this
->
assertEquals
(
$array
,
SimpleSAML\Utils\
Arrays
::
arrayize
(
$array
));
$this
->
assertEquals
(
$array
,
Arrays
::
arrayize
(
$array
));
// check non-empty array as input
$array
=
array
(
'key'
=>
'value'
);
$this
->
assertEquals
(
$array
,
SimpleSAML\Utils\
Arrays
::
arrayize
(
$array
));
$this
->
assertEquals
(
$array
,
Arrays
::
arrayize
(
$array
));
// check indexes are ignored when input is an array
$this
->
assertArrayNotHasKey
(
'invalid'
,
SimpleSAML\Utils\
Arrays
::
arrayize
(
$array
,
'invalid'
));
$this
->
assertArrayNotHasKey
(
'invalid'
,
Arrays
::
arrayize
(
$array
,
'invalid'
));
// check default index
$expected
=
array
(
'string'
);
$this
->
assertEquals
(
$expected
,
SimpleSAML\Utils\
Arrays
::
arrayize
(
$expected
[
0
]));
$this
->
assertEquals
(
$expected
,
Arrays
::
arrayize
(
$expected
[
0
]));
// check string index
$index
=
'key'
;
$expected
=
array
(
$index
=>
'string'
);
$this
->
assertEquals
(
$expected
,
SimpleSAML\Utils\
Arrays
::
arrayize
(
$expected
[
$index
],
$index
));
$this
->
assertEquals
(
$expected
,
Arrays
::
arrayize
(
$expected
[
$index
],
$index
));
}
...
...
@@ -41,11 +44,11 @@ class Utils_ArraysTest extends PHPUnit_Framework_TestCase
{
// check bad arrays
$this
->
assertFalse
(
SimpleSAML\Utils\
Arrays
::
transpose
(
array
(
'1'
,
'2'
,
'3'
)),
Arrays
::
transpose
(
array
(
'1'
,
'2'
,
'3'
)),
'Invalid two-dimensional array was accepted'
);
$this
->
assertFalse
(
SimpleSAML\Utils\
Arrays
::
transpose
(
array
(
'1'
=>
0
,
'2'
=>
'0'
,
'3'
=>
array
(
0
))),
Arrays
::
transpose
(
array
(
'1'
=>
0
,
'2'
=>
'0'
,
'3'
=>
array
(
0
))),
'Invalid elements on a two-dimensional array were accepted'
);
...
...
@@ -70,7 +73,7 @@ class Utils_ArraysTest extends PHPUnit_Framework_TestCase
);
$this
->
assertEquals
(
$transposed
,
SimpleSAML\Utils\
Arrays
::
transpose
(
$array
),
Arrays
::
transpose
(
$array
),
'Unexpected result of transpose()'
);
...
...
@@ -95,7 +98,7 @@ class Utils_ArraysTest extends PHPUnit_Framework_TestCase
);
$this
->
assertEquals
(
$transposed
,
SimpleSAML\Utils\
Arrays
::
transpose
(
$array
),
Arrays
::
transpose
(
$array
),
'Unexpected result of transpose()'
);
...
...
@@ -122,7 +125,7 @@ class Utils_ArraysTest extends PHPUnit_Framework_TestCase
);
$this
->
assertEquals
(
$transposed
,
SimpleSAML\Utils\
Arrays
::
transpose
(
$array
),
Arrays
::
transpose
(
$array
),
'Unexpected result of transpose()'
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment