Remove broken test.
authorjeroendedauw <jeroendedauw@gmail.com>
Fri, 7 Dec 2012 18:42:13 +0000 (19:42 +0100)
committerjeroendedauw <jeroendedauw@gmail.com>
Sat, 8 Dec 2012 18:26:40 +0000 (19:26 +0100)
Calling the method does not raise an exception but a notice (depending on settings).
PHPUnit just happens to turn this into an exception. The test thus breaks if PHPUnit
does not do this, which apparently happens in some cases and caused bug 41491

Change-Id: I9d14fd875c70c8b3d164c0b8a4fa2667c5769682

tests/phpunit/includes/libs/GenericArrayObjectTest.php

index 398ad2d..7be4043 100644 (file)
@@ -110,7 +110,10 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
         * @param GenericArrayObject $list
         */
        public function testUnset( GenericArrayObject $list ) {
-               if ( !$list->isEmpty() ) {
+               if ( $list->isEmpty() ) {
+                       $this->assertTrue( true ); // We cannot test unset if there are no elements
+               }
+               else {
                        $offset = $list->getIterator()->key();
                        $count = $list->count();
                        $list->offsetUnset( $offset );
@@ -123,10 +126,6 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
                        unset( $list[$offset] );
                        $this->assertEquals( $count - 1, $list->count() );
                }
-
-               $exception = null;
-               try { $list->offsetUnset( 'sdfsedtgsrdysftu' ); } catch ( \Exception $exception ){}
-               $this->assertInstanceOf( '\Exception', $exception );
        }
 
        /**