本文整理汇总了PHP中AcceptanceTester类的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester类的具体用法?PHP AcceptanceTester怎么用?PHP AcceptanceTester使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AcceptanceTester类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ClearAllCach
/**
* Clear cache work only at admin panel
* @param AcceptanceTester $I Controller
*/
public static function ClearAllCach($I)
{
$I->amOnPage('/admin');
$I->click(NavigationBarPage::$System);
$I->click(NavigationBarPage::$SystemClearAllCach);
$I->wait(3);
}
示例2: testIfICantCreateAnEventWithoutBeingAuthenticated
public function testIfICantCreateAnEventWithoutBeingAuthenticated(AcceptanceTester $I)
{
$I->am('guest');
$I->wantTo('see that i can\'t create an event');
$I->amOnPage('event/create');
$I->canSee('have to be logged in', '.alert-danger');
}
示例3: testAPI
public function testAPI(AcceptanceTester $I)
{
$I->wantTo('test the API');
$data = new stdClass();
$data->contact = new stdClass();
$data->contact->email = $this->faker->safeEmail;
$clientId = $this->createEntity('client', $data);
$this->listEntities('client');
$data = new stdClass();
$data->client_id = $clientId;
$data->description = $this->faker->realText(100);
$this->createEntity('task', $data);
$this->listEntities('task');
$lineItem = new stdClass();
$lineItem->qty = $this->faker->numberBetween(1, 10);
$lineItem->cost = $this->faker->numberBetween(1, 10);
$data = new stdClass();
$data->client_id = $clientId;
$data->invoice_items = [$lineItem];
$invoiceId = $this->createEntity('invoice', $data);
$this->listEntities('invoice');
$data = new stdClass();
$data->invoice_id = $invoiceId;
$data->amount = 1;
$this->createEntity('payment', $data);
$this->listEntities('payment');
$this->listEntities('account');
}
示例4: submitTheForm
private function submitTheForm(AcceptanceTester $I, $attributes)
{
$I->waitForElement('form', 2);
$I->fillField('form #title', $attributes['title']);
$I->fillField('form #content', $attributes['content']);
$I->click('form .btn-primary');
}
示例5: loginWithoutEmail
function loginWithoutEmail(\AcceptanceTester $I, \Page\Login $loginPage)
{
$I->wantTo("Check login with No Email and Valid Password");
$loginPage->loginWithPasswordOnly('debby');
$I->seeElement('div[class = "control-group email error"]');
$I->dontSeeInCurrentUrl('activities');
}
示例6: formManagerOpensNewForm
/**
* Tests that form manager opens on the new form page
*
* @since 7.0
* @param \GLM\Tests\Acceptance\AcceptanceTester $I The current actor.
*/
public function formManagerOpensNewForm(AcceptanceTester $I)
{
$I->wantTo('Ensure the form manager opens in the new form page');
$I->amOnPage(admin_url('post-new.php?post_type=ccf_form'));
$I->click('Manage Form');
$I->see('Click on a field to edit it');
}
示例7: setLoginCookies
/**
* @param AcceptanceTester $I
*/
protected function setLoginCookies(\AcceptanceTester $I)
{
$authTokenName = (string) $this->tokenNames['authtoken'];
$sessionTokenName = (string) $this->tokenNames['session'];
$I->setCookie($this->tokenNames['authtoken'], $this->cookies[$authTokenName]);
$I->setCookie($this->tokenNames['session'], $this->cookies[$sessionTokenName]);
}
示例8: loginWithInvalidCredentials
public function loginWithInvalidCredentials(AcceptanceTester $I)
{
$I->amOnPage('/login');
$I->click('Login');
$I->seeCurrentUrlEquals('/login');
$I->see('Invalid Credentials', '.flash');
}
示例9: testShowAction
public function testShowAction(AcceptanceTester $I)
{
$I->wantTo('too see inside the dashboard area');
$I->amOnPage('/dashboard');
$I->see('a placeholder for dashboard');
$I->wait(3);
}
示例10: viewHomepage
public function viewHomepage(AcceptanceTester $I)
{
$I->wantTo('view the homepage');
$I->amOnPage('/');
$I->see('Zen Kommerce');
//$I->dontSeeHttpHeader('Set-Cookie');
}
示例11: tryToTest
public function tryToTest(AcceptanceTester $I)
{
$I->expectARequestToRemoteServiceWithAResponse(Phiremock::on(A::getRequest()->andUrl(Is::equalTo('/some/url')))->then(Respond::withStatusCode(203)->andBody('I am a response')));
$response = file_get_contents('http://localhost:18080/some/url');
$I->assertEquals('I am a response', $response);
$I->seeRemoteServiceReceived(1, A::getRequest()->andUrl(Is::equalTo('/some/url')));
}
示例12: it_validates_required_fields
public function it_validates_required_fields(AcceptanceTester $I)
{
$I->amOnRoute(LoginPage::$ROUTE);
$I->submitForm(LoginPage::$formId, [], 'Login');
$I->see('The username field is required.');
$I->see('The password field is required.');
}
示例13: startAConversation
/**
* @param AcceptanceTester $I
*/
public function startAConversation(AcceptanceTester $I)
{
$I->wantToTest('if I can start a conversation');
$I->amOnPage('/messages');
$I->click('#startConversation');
$I->see('Send a message');
}
示例14: it_prevents_guests_from_seeing_profiles
public function it_prevents_guests_from_seeing_profiles(AcceptanceTester $I)
{
$user = $this->userActor->create();
$I->amOnRoute('profile.show', $user->username);
$I->seeInCurrentUrl('auth/login');
$I->seeCurrentRouteIs('auth.login');
$I->dontSee('Profile of user');
}
示例15: createAnExpectationWithRegexReplacementFromBodyAndUrl
public function createAnExpectationWithRegexReplacementFromBodyAndUrl(AcceptanceTester $I)
{
$expectation = PhiremockClient::on(A::postRequest()->andUrl(Is::matching('/&test=(\\d+)/'))->andBody(Is::matching('/a tomato (\\d+)/')))->then(Respond::withStatusCode(200)->andBody('the numbers are ${url.1} and ${body.1}'));
$this->phiremock->createExpectation($expectation);
$I->sendPOST('/potato?param1=123&test=456', 'this is a tomato 3kg it weights');
$I->seeResponseCodeIs('200');
$I->seeResponseContains('the numbers are 456 and 3');
}