tests: Fix broken assertion in ApiQueryAllPagesTest
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Mon, 30 Sep 2019 14:22:54 +0000 (16:22 +0200)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Mon, 30 Sep 2019 14:22:54 +0000 (16:22 +0200)
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

index 2d89aa5..a42aea0 100644 (file)
@@ -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] );
        }
 }