diff --git a/Test/Case/Controller/Component/FilterComponentTest.php b/Test/Case/Controller/Component/FilterComponentTest.php index 85620de..a0b8dbd 100644 --- a/Test/Case/Controller/Component/FilterComponentTest.php +++ b/Test/Case/Controller/Component/FilterComponentTest.php @@ -66,8 +66,10 @@ public function setUp(): void $this->Controller->Components->trigger('initialize', array($this->Controller)); } - public function endTest($method) + public function tearDown(): void { + parent::tearDown(); + $this->Controller->Session->destroy(); unset($this->Controller); } @@ -211,11 +213,14 @@ public function testSessionStartupData(): void $this->assertSame('Filter model not found: FakeNonexistant', $e1->getMessage()); } + $filterValues = array('Document' => array('title' => 'in')); + $this->Controller->Session->write($sessionKey, $filterValues); + try { $this->Controller->Components->trigger('startup', array($this->Controller)); $this->fail('InvalidArgumentException was not thrown'); } catch (InvalidArgumentException $e2) { - $this->assertSame('xxxFilter model not found: FakeNonexistant', $e2->getMessage()); + $this->assertSame('Filter model not found: FakeNonexistant', $e2->getMessage()); } $actualFilterValues = $this->Controller->Document->getFilterValues(); $this->assertEquals( @@ -223,16 +228,6 @@ public function testSessionStartupData(): void $actualFilterValues[$this->Controller->Document->alias] ); - $filterValues = array('Document' => array('title' => 'in')); - $this->Controller->Session->write($sessionKey, $filterValues); - - $this->Controller->Components->trigger('startup', array($this->Controller)); - $actualFilterValues = $this->Controller->Document->getFilterValues(); - $this->assertEquals( - $filterValues, - $actualFilterValues[$this->Controller->Document->alias] - ); - $this->Controller->Session->delete($sessionKey); }