本文整理汇总了PHP中FunctionalTester::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionalTester::logout方法的具体用法?PHP FunctionalTester::logout怎么用?PHP FunctionalTester::logout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionalTester
的用法示例。
在下文中一共展示了FunctionalTester::logout方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _after
public function _after(FunctionalTester $I)
{
$I->amOnPage(PostsPage::$url);
$I->seeCurrentUrlEquals(PostsPage::$url);
$I->seeAuthentication();
$I->logout();
$I->dontSeeAuthentication();
}
示例2: loginUsingCredentials
public function loginUsingCredentials(FunctionalTester $I)
{
$I->dontSeeAuthentication();
$I->haveRecord('users', $this->userAttributes);
$I->amLoggedAs(['email' => 'john@doe.com', 'password' => 'password']);
$I->amOnPage(PostsPage::$url);
$I->seeCurrentUrlEquals(PostsPage::$url);
$I->seeAuthentication();
$I->logout();
$I->dontSeeAuthentication();
}
示例3: tryToCreateModifyAndDeleteContent
public function tryToCreateModifyAndDeleteContent(FunctionalTester $I)
{
$I->am('Anonymous user');
$I->sendPOST('api/contents.json', $this->content3);
$I->seeResponseCodeIs(401);
$I->sendPUT('api/contents/' . $this->content2['key'] . '.json');
$I->seeResponseCodeIs(401);
$I->sendDELETE('api/contents/' . $this->content2['key'] . '.json');
$I->seeResponseCodeIs(401);
$I->am('ROLE_USER');
$I->login($this->user['email']);
$I->sendPOST('api/contents.json', $this->content3);
$I->seeResponseCodeIs(403);
$I->sendPUT('api/contents/' . $this->content2['key'] . '.json');
$I->seeResponseCodeIs(403);
$I->sendDELETE('api/contents/' . $this->content2['key'] . '.json');
$I->seeResponseCodeIs(403);
$I->am('ROLE_ADMIN');
$I->login($this->admin['email']);
$I->sendPOST('api/contents.json', $this->content3);
$I->seeResponseCodeIs(200);
$I->seeResponseContainsJson($this->content3);
$id = $I->grabDataFromResponseByJsonPath('$.id')[0];
$I->sendGET('api/contents/' . $this->content3['key'] . '.json');
$I->seeResponseCodeIs(200);
$I->seeResponseContainsJson($this->content3);
$I->sendGET('api/contents/' . $id . '.json');
$I->seeResponseCodeIs(200);
$I->seeResponseContainsJson($this->content3);
$this->content3['title'] = 'new title';
$I->sendPUT('api/contents/' . $id . '.json', $this->content3);
$I->seeResponseCodeIs(200);
$I->seeResponseContainsJson($this->content3);
$I->sendGET('api/contents/' . $id . '.json');
$I->seeResponseCodeIs(200);
$I->seeResponseContainsJson($this->content3);
$I->sendDELETE('api/contents/' . $id . '.json');
$I->seeResponseCodeIs(204);
$I->sendGET('api/contents/' . $id . '.json');
$I->seeResponseCodeIs(404);
$I->logout();
$I->sendGET('api/contents/' . $id . '.json');
$I->seeResponseCodeIs(401);
}
示例4: FunctionalTester
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('register a user from index page');
$I->expectTo('have a users in the database');
$I->amOnPage('/');
$I->haveRecord('users', ['email' => 'andela@andela.com', 'username' => 'andelabendozy', 'password' => bcrypt('password'), 'created_at' => new DateTime(), 'updated_at' => new DateTime(), 'status' => TRUE, 'profile_state' => FALSE]);
$I->submitForm('form#register', ['name' => 'prosper', 'email' => 'andela11@andela.com', 'password' => '12345678', 'password_confirmation' => '12345678']);
$I->seeAuthentication();
$I->seeCurrentUrlEquals('');
$I->seeRecord('users', ['email' => 'andela@andela.com']);
$I->seeAuthentication();
$I->wantTo('logout');
$I->logout();
$I->dontSeeAuthentication();
示例5: _after
public function _after(FunctionalTester $I)
{
$I->logout();
}
示例6: _after
public function _after(FunctionalTester $I)
{
$I->logout();
$I->dontSeeAuthentication();
}