From d5287675675fe10b9e4ee7e6f9a55f98bd46fea1 Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Fri, 7 Dec 2012 19:42:13 +0100 Subject: [PATCH] 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 --- tests/phpunit/includes/libs/GenericArrayObjectTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 ); } /** -- 2.20.1