Skip to content

Commit f349809

Browse files
committed
Fix tests.
1 parent 206e4ae commit f349809

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

tests/TestCase/Controller/Component/AuthComponentTest.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public function testValid() {
6565
$this->AuthComponent->initialize($config);
6666

6767
$event = new Event('Controller.startup', $controller);
68-
$response = $this->AuthComponent->startup($event);
68+
$this->AuthComponent->startup($event);
69+
70+
$response = $event->getResult();
6971
$this->assertNull($response);
7072
}
7173

@@ -90,7 +92,9 @@ public function testValidAnyAction() {
9092
$this->AuthComponent->initialize($config);
9193

9294
$event = new Event('Controller.startup', $controller);
93-
$response = $this->AuthComponent->startup($event);
95+
$this->AuthComponent->startup($event);
96+
97+
$response = $event->getResult();
9498
$this->assertNull($response);
9599
}
96100

@@ -116,7 +120,9 @@ public function testDeniedActionInController() {
116120
$controller->beforeFilter($event);
117121

118122
$event = new Event('Controller.startup', $controller);
119-
$response = $controller->Auth->startup($event);
123+
$controller->Auth->startup($event);
124+
125+
$response = $event->getResult();
120126
$this->assertInstanceOf(Response::class, $response);
121127
$this->assertSame(302, $response->getStatusCode());
122128
}
@@ -144,7 +150,9 @@ public function testDeniedAction() {
144150
$controller->beforeFilter($event);
145151

146152
$event = new Event('Controller.startup', $controller);
147-
$response = $controller->Auth->startup($event);
153+
$controller->Auth->startup($event);
154+
155+
$response = $event->getResult();
148156
$this->assertInstanceOf(Response::class, $response);
149157
$this->assertSame(302, $response->getStatusCode());
150158
}
@@ -169,7 +177,9 @@ public function testValidActionNestedPrefix() {
169177
$this->AuthComponent->initialize($config);
170178

171179
$event = new Event('Controller.startup', $controller);
172-
$response = $this->AuthComponent->startup($event);
180+
$this->AuthComponent->startup($event);
181+
182+
$response = $event->getResult();
173183
$this->assertNull($response);
174184
}
175185

@@ -194,7 +204,9 @@ public function testDeniedActionNestedPrefix() {
194204
$controller->beforeFilter($event);
195205

196206
$event = new Event('Controller.startup', $controller);
197-
$response = $controller->Auth->startup($event);
207+
$controller->Auth->startup($event);
208+
209+
$response = $event->getResult();
198210
$this->assertInstanceOf(Response::class, $response);
199211
$this->assertSame(302, $response->getStatusCode());
200212
}
@@ -220,8 +232,9 @@ public function testInvalid() {
220232
$this->AuthComponent->initialize($config);
221233

222234
$event = new Event('Controller.startup', $controller);
223-
$response = $this->AuthComponent->startup($event);
235+
$this->AuthComponent->startup($event);
224236

237+
$response = $event->getResult();
225238
$this->assertInstanceOf(Response::class, $response);
226239
$this->assertSame(302, $response->getStatusCode());
227240
}

0 commit comments

Comments
 (0)