From d2227f415a9bffeda82fcc1bd98df5953bd3cccc Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Mon, 30 Sep 2019 16:22:54 +0200 Subject: [PATCH] tests: Fix broken assertion in ApiQueryAllPagesTest The description had two errors: * It talked about the presence of a specific value, but all it did was checking a count. * It was talking about the value *not* being there. I just removed it. The possible error message from PHPUnit should be good enough. Change-Id: I7ea85dd37db8969bdd120f9600eeb6145e42eb1e --- tests/phpunit/includes/api/ApiQueryAllPagesTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/phpunit/includes/api/ApiQueryAllPagesTest.php b/tests/phpunit/includes/api/ApiQueryAllPagesTest.php index 2d89aa5433..a42aea0f6e 100644 --- a/tests/phpunit/includes/api/ApiQueryAllPagesTest.php +++ b/tests/phpunit/includes/api/ApiQueryAllPagesTest.php @@ -30,7 +30,6 @@ class ApiQueryAllPagesTest extends ApiTestCase { $this->assertArrayHasKey( 'query', $result[0] ); $this->assertArrayHasKey( 'allpages', $result[0]['query'] ); - $this->assertNotEquals( 0, count( $result[0]['query']['allpages'] ), - 'allpages list does not contain page Category:Template:xyz' ); + $this->assertContains( 'Category:Template:xyz', $result[0]['query']['allpages'][0] ); } } -- 2.20.1