controller; } if ($actual instanceof Controller) { $actual = $actual->response->location(); } if ($actual instanceof Response) { $actual = $actual->location(); } if (empty($actual)) { throw new \Exception('assertRedirect: Expected "actual" to be a non-empty string'); } if (is_array($expected)) { $expected = Router::url($expected); } $this->assertEquals($expected, $actual, 'Was not redirected to ' . $expected); } }