Merge "tests: Replace assertions on count() == 0 with strict === []"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 30 Sep 2019 17:43:35 +0000 (17:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 30 Sep 2019 17:43:35 +0000 (17:43 +0000)
tests/phpunit/includes/api/ApiWatchTest.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
tests/phpunit/includes/session/SessionBackendTest.php

index 24d016e..e76126f 100644 (file)
@@ -64,7 +64,7 @@ class ApiWatchTest extends ApiTestCase {
                                unset( $data[0]['query']['watchlist'][$index] );
                        }
                }
-               $this->assertSame( 0, count( $data[0]['query']['watchlist'] ) );
+               $this->assertSame( [], $data[0]['query']['watchlist'] );
 
                return $data;
        }
index 0c084e0..5586fa1 100644 (file)
@@ -610,7 +610,7 @@ class WANObjectCacheTest extends PHPUnit\Framework\TestCase {
                $asycList[0](); // run the refresh callback
                $asycList = [];
                $this->assertEquals( 2, $wasSet, "Value calculated at later time" );
-               $this->assertSame( 0, count( $asycList ), "No deferred refreshes added." );
+               $this->assertSame( [], $asycList, "No deferred refreshes added." );
                $v = $cache->getWithSetCallback( $key, 300, $func, $opts );
                $this->assertEquals( $value, $v, "New value stored" );
 
index a1fdf8a..eba1bcb 100644 (file)
@@ -224,7 +224,7 @@ class SessionBackendTest extends MediaWikiTestCase {
                }
 
                $session2 = null;
-               $this->assertSame( 0, count( $priv->requests ) );
+               $this->assertSame( [], $priv->requests );
                $this->assertArrayNotHasKey( $backend->getId(), $manager->allSessionBackends );
                $this->assertArrayHasKey( $backend->getId(), $manager->allSessionIds );
        }