/** * Settings pages should not be allowed to access non-authorized users, user should be redirected this time. */ public function testActionsWhenNotLoggedInRedirectToLogin() { $client = $this->client->getClient(); $client->followRedirects(true); $client->request('GET', '/settings/logout'); // Visit settings page. $client->request('GET', '/settings/settings'); // Assert successful redirect when not logged in. $this->assertStringEndsWith('login', $client->getRequest()->getUri(), 'response must be a correct redirect'); }
/** * Test for removeAction(). * * @param string $url * @param string $expectedStatusCode * * @dataProvider removeActionData() */ public function testRemoveAction($url, $expectedStatusCode) { $this->createSetting(); $this->client->request('DELETE', $url); $this->assertEquals($expectedStatusCode, $this->client->getResponse()->getStatusCode()); }