diff --git a/test/AutoloaderFactoryTest.php b/test/AutoloaderFactoryTest.php index 89d2d17..69dbcf3 100644 --- a/test/AutoloaderFactoryTest.php +++ b/test/AutoloaderFactoryTest.php @@ -60,7 +60,7 @@ public function testRegisteringValidMapFilePopulatesAutoloader() $loader = AutoloaderFactory::getRegisteredAutoloader('Zend\Loader\ClassMapAutoloader'); $map = $loader->getAutoloadMap(); $this->assertInternalType('array', $map); - $this->assertEquals(2, count($map)); + $this->assertCount(2, $map); } /** @@ -85,7 +85,7 @@ public function testFactoryDoesNotRegisterDuplicateAutoloaders() ], ], ]); - $this->assertEquals(1, count(AutoloaderFactory::getRegisteredAutoloaders())); + $this->assertCount(1, AutoloaderFactory::getRegisteredAutoloaders()); AutoloaderFactory::factory([ 'Zend\Loader\StandardAutoloader' => [ 'namespaces' => [ @@ -93,7 +93,7 @@ public function testFactoryDoesNotRegisterDuplicateAutoloaders() ], ], ]); - $this->assertEquals(1, count(AutoloaderFactory::getRegisteredAutoloaders())); + $this->assertCount(1, AutoloaderFactory::getRegisteredAutoloaders()); $this->assertTrue(class_exists('TestNamespace\NoDuplicateAutoloadersCase')); $this->assertTrue(class_exists('ZendTest\Loader\TestAsset\TestPlugins\Foo')); } @@ -108,7 +108,7 @@ public function testCanUnregisterAutoloaders() ], ]); AutoloaderFactory::unregisterAutoloaders(); - $this->assertEquals(0, count(AutoloaderFactory::getRegisteredAutoloaders())); + $this->assertCount(0, AutoloaderFactory::getRegisteredAutoloaders()); } public function testCanUnregisterAutoloadersByClassName() @@ -121,7 +121,7 @@ public function testCanUnregisterAutoloadersByClassName() ], ]); AutoloaderFactory::unregisterAutoloader('Zend\Loader\StandardAutoloader'); - $this->assertEquals(0, count(AutoloaderFactory::getRegisteredAutoloaders())); + $this->assertCount(0, AutoloaderFactory::getRegisteredAutoloaders()); } public function testCanGetValidRegisteredAutoloader() @@ -142,7 +142,7 @@ public function testDefaultAutoloader() AutoloaderFactory::factory(); $autoloader = AutoloaderFactory::getRegisteredAutoloader('Zend\Loader\StandardAutoloader'); $this->assertInstanceOf('Zend\Loader\StandardAutoloader', $autoloader); - $this->assertEquals(1, count(AutoloaderFactory::getRegisteredAutoloaders())); + $this->assertCount(1, AutoloaderFactory::getRegisteredAutoloaders()); } public function testGetInvalidAutoloaderThrowsException() @@ -174,7 +174,7 @@ public function testPassingNoArgumentsToFactoryInstantiatesAndRegistersStandardA { AutoloaderFactory::factory(); $loaders = AutoloaderFactory::getRegisteredAutoloaders(); - $this->assertEquals(1, count($loaders)); + $this->assertCount(1, $loaders); $loader = array_shift($loaders); $this->assertInstanceOf('Zend\Loader\StandardAutoloader', $loader); diff --git a/test/ClassMapAutoloaderTest.php b/test/ClassMapAutoloaderTest.php index a1effbe..f12f987 100644 --- a/test/ClassMapAutoloaderTest.php +++ b/test/ClassMapAutoloaderTest.php @@ -92,13 +92,13 @@ public function testRegisteringValidMapFilePopulatesAutoloader() $this->loader->registerAutoloadMap(__DIR__ . '/_files/goodmap.php'); $map = $this->loader->getAutoloadMap(); $this->assertInternalType('array', $map); - $this->assertEquals(2, count($map)); + $this->assertCount(2, $map); // Just to make sure nothing changes after loading the same map again // (loadMapFromFile should just return) $this->loader->registerAutoloadMap(__DIR__ . '/_files/goodmap.php'); $map = $this->loader->getAutoloadMap(); $this->assertInternalType('array', $map); - $this->assertEquals(2, count($map)); + $this->assertCount(2, $map); } public function testRegisteringMultipleMapsMergesThem() @@ -114,7 +114,7 @@ public function testRegisteringMultipleMapsMergesThem() $test = $this->loader->getAutoloadMap(); $this->assertInternalType('array', $test); - $this->assertEquals(3, count($test)); + $this->assertCount(3, $test); $this->assertNotEquals( $map['ZendTest\Loader\StandardAutoloaderTest'], $test['ZendTest\Loader\StandardAutoloaderTest'] @@ -133,7 +133,7 @@ public function testCanRegisterMultipleMapsAtOnce() $this->loader->registerAutoloadMaps($maps); $test = $this->loader->getAutoloadMap(); $this->assertInternalType('array', $test); - $this->assertEquals(3, count($test)); + $this->assertCount(3, $test); } public function testRegisterMapsThrowsExceptionForNonTraversableArguments() @@ -191,6 +191,6 @@ public function testCanLoadClassMapFromPhar() // @codingStandardsIgnoreEnd $this->loader->registerAutoloadMap($map); $test = $this->loader->getAutoloadMap(); - $this->assertEquals(1, count($test)); + $this->assertCount(1, $test); } }