From 4f6b1c1436753b726b4f143f78705f1d2036c9d7 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Fri, 26 Feb 2016 11:35:43 +0100 Subject: [PATCH] Move Utils_ArraysTest to SimpleSAML\Test\Utils\ArraysTest. --- tests/lib/SimpleSAML/Utils/ArraysTest.php | 25 +++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/lib/SimpleSAML/Utils/ArraysTest.php b/tests/lib/SimpleSAML/Utils/ArraysTest.php index 1c1cd5787..e32c8aee2 100644 --- a/tests/lib/SimpleSAML/Utils/ArraysTest.php +++ b/tests/lib/SimpleSAML/Utils/ArraysTest.php @@ -1,10 +1,13 @@ <?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()' ); } -- GitLab