Пример #1
0
<?php

use Arc\Users\User;
$I = new FunctionalTester($scenario);
$I->wantTo('login to the Arc System');
$I->am('valid User');
$I->haveAnAccount();
$I->amOnPage('/login');
$I->fillField('email', '*****@*****.**');
$I->fillField('password', 'a52Vaza09@');
$I->click('Sign In');
$I->seeCurrentUrlEquals('/admin');
$I->see('You are logged in.');
Пример #2
0
<?php

$I = new FunctionalTester($scenario);
$I->am('a Larabook member');
$I->wantTo('list all members who are a member of Larabook');
$I->haveAnAccount(['username' => 'Foo']);
$I->haveAnAccount(['username' => 'Bar']);
$I->amOnPage('/users');
$I->see('Foo');
$I->see('Bar');
<?php

$I = new FunctionalTester($scenario);
$I->am('a Larabook user');
$I->wantTo('Follow other larabook users');
$I->haveAnAccount(['id' => 88, 'name' => 'Other User', 'email' => '*****@*****.**', 'password' => bcrypt('secret')]);
$I->logIn();
$I->click('Browse Users');
$I->click(2);
$I->click('Other User');
$I->seeCurrentUrlEquals('/users/88');
// When I follow a user...
$I->click('Follow Other User');
$I->seeCurrentUrlEquals('/users/88');
$I->see('You are now following Other User');
$I->See('Unfollow Other User');
/*
 * Acceptance test = Client's point of view
 * Functional test = From Developer's point of view
 */
// When I unfollow a user...
$I->click('Unfollow Other User');
$I->seeCurrentUrlEquals('/users/88');
$I->see('Follow Other User');
Пример #4
0
<?php
    $I = new FunctionalTester($scenario);
    $I->am("a Larabook User");
    $I->wantTo('perform actions and see result');
    $I->haveAnAccount(['username' => 'OtherUser']);
    $I->signIn();
    $I->click('Browse Users');
    $I->click('OtherUser');
    $I->seeCurrentUrlEquals('/@OtherUser');
    $I->click('Follow OtherUser');
    $I->seeCurrentUrlEquals('/@OtherUser');
    $I->see('Unfollow OtherUser');
    $I->click('Unfollow OtherUser');
    $I->seeCurrentUrlEquals('/@OtherUser');
    $I->see('Follow OtherUser');
Пример #5
0
<?php

$I = new FunctionalTester($scenario);
$I->am('a member');
$I->wantTo('review all users who are registered');
// setup
$I->haveAnAccount(['username' => 'foo']);
$I->haveAnAccount(['username' => 'bar']);
// action
$I->amOnPage('/users');
$I->see('foo');
$I->see('bar');