X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flibs%2FGenericArrayObjectTest.php;h=12c57871c7249dcfb608a76a97a21eab89f21237;hb=c8e7720261d3b1c6b69cf2bf3e65b2ef5d8e65a5;hp=e2ec47416c458ad989d6fbc9a771e067dc8501de;hpb=498693b9eaddaf59dfb2cba5020df4dfb5fffa56;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php index e2ec47416c..12c57871c7 100644 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php @@ -24,13 +24,13 @@ * @ingroup Test * @group GenericArrayObject * - * @licence GNU GPL v2+ * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ -abstract class GenericArrayObjectTest extends MediaWikiTestCase { +abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase { /** - * Returns objects that can serve as elements in the concrete GenericArrayObject deriving class being tested. + * Returns objects that can serve as elements in the concrete + * GenericArrayObject deriving class being tested. * * @since 1.20 * @@ -55,7 +55,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase { * @return array */ public function instanceProvider() { - $instances = array(); + $instances = []; foreach ( $this->elementInstancesProvider() as $elementInstances ) { $instances[] = $this->getNew( $elementInstances[0] ); @@ -71,7 +71,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase { * * @return GenericArrayObject */ - protected function getNew( array $elements = array() ) { + protected function getNew( array $elements = [] ) { $class = $this->getInstanceClass(); return new $class( $elements ); @@ -104,7 +104,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase { public function testIsEmpty( array $elements ) { $arrayObject = $this->getNew( $elements ); - $this->assertEquals( $elements === array(), $arrayObject->isEmpty() ); + $this->assertEquals( $elements === [], $arrayObject->isEmpty() ); } /** @@ -170,7 +170,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase { /** * @since 1.20 * - * @param callback $function + * @param callable $function * * @covers GenericArrayObject::getObjectType */ @@ -180,7 +180,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase { $elementClass = $list->getObjectType(); - foreach ( array( 42, 'foo', array(), new stdClass(), 4.2 ) as $element ) { + foreach ( [ 42, 'foo', [], new stdClass(), 4.2 ] as $element ) { $validValid = $element instanceof $elementClass; try { @@ -208,7 +208,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase { * @covers GenericArrayObject::offsetSet */ public function testOffsetSet( array $elements ) { - if ( $elements === array() ) { + if ( $elements === [] ) { $this->assertTrue( true ); return;