From: jeroendedauw Date: Fri, 7 Dec 2012 18:42:13 +0000 (+0100) Subject: Remove broken test. X-Git-Tag: 1.31.0-rc.0~21376^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=d5287675675fe10b9e4ee7e6f9a55f98bd46fea1;p=lhc%2Fweb%2Fwiklou.git Remove broken test. 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 --- diff --git a/tests/phpunit/includes/libs/GenericArrayObjectTest.php b/tests/phpunit/includes/libs/GenericArrayObjectTest.php index 398ad2d709..7be4043230 100644 --- a/tests/phpunit/includes/libs/GenericArrayObjectTest.php +++ b/tests/phpunit/includes/libs/GenericArrayObjectTest.php @@ -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 ); } /**