From d59ba45ab6433780c6ba0fcf392c98f687243c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Pustu=C5=82ka?= Date: Tue, 9 May 2017 11:18:04 +0200 Subject: [PATCH] Fixed some typos. Added assertion for unload return result. --- tests/TestCase/Controller/ComponentRegistryTest.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/TestCase/Controller/ComponentRegistryTest.php b/tests/TestCase/Controller/ComponentRegistryTest.php index f372cb47bff..cfeebd3ecc7 100644 --- a/tests/TestCase/Controller/ComponentRegistryTest.php +++ b/tests/TestCase/Controller/ComponentRegistryTest.php @@ -201,9 +201,10 @@ public function testUnload() { $eventManager = $this->Components->getController()->getEventManager(); - $result = $this->Components->load('Auth'); - $this->Components->unload('Auth'); + $this->Components->load('Auth'); + $result = $this->Components->unload('Auth'); + $this->assertSame($this->Components, $result); $this->assertFalse(isset($this->Components->Auth), 'Should be gone'); $this->assertCount(0, $eventManager->listeners('Controller.startup')); } @@ -213,11 +214,11 @@ public function testUnload() * * @return void */ - public function testUset() + public function testUnset() { $eventManager = $this->Components->getController()->getEventManager(); - $result = $this->Components->load('Auth'); + $this->Components->load('Auth'); unset($this->Components->Auth); $this->assertFalse(isset($this->Components->Auth), 'Should be gone'); @@ -250,7 +251,7 @@ public function testSet() $result = $this->Components->set('Auth', $auth); $this->assertSame($this->Components, $result); - $this->assertTrue(isset($this->Components->Auth), 'Should be gone'); + $this->assertTrue(isset($this->Components->Auth), 'Should be present'); $this->assertCount(1, $eventManager->listeners('Controller.startup')); } @@ -267,7 +268,7 @@ public function testMagicSet() $auth = new AuthComponent($this->Components); $this->Components->Auth = $auth; - $this->assertTrue(isset($this->Components->Auth), 'Should be gone'); + $this->assertTrue(isset($this->Components->Auth), 'Should be present'); $this->assertCount(1, $eventManager->listeners('Controller.startup')); }