Exemplo n.º 1
0
 /**
  * Submit the project create/update form.
  * @param \AcceptanceTester|\FunctionalTester $I
  * @param array                               $fields
  */
 public static function submit($I, $fields)
 {
     if ($fields['image']) {
         $I->attachFile('#uploadform-newimage', $fields['image']);
     }
     $I->fillField(['name' => 'Project[name]'], $fields['name']);
     $I->selectOption(['name' => 'Project[coordinator]'], $fields['coordinator']);
     $I->fillField(['name' => 'Project[status]'], $fields['status']);
     $I->fillField(['name' => 'UploadForm[newImageDescription][]'], $fields['imageDescription']);
     $I->click('#project-form button');
 }
<?php

use Mockery as m;
$I = new FunctionalTester($scenario);
$I->am('a guest');
$I->wantTo('sign up to build brighton');
$I->amOnPage('/');
$I->click('Become a Member');
$I->seeCurrentUrlEquals('/register');
$I->fillField('First Name', 'Jon');
$I->fillField('Family Name', 'Doe');
$I->fillField('Email', '*****@*****.**');
$I->fillField('Password', '12345678');
$I->fillField(['name' => 'address[line_1]'], 'Street Address');
$I->fillField(['name' => 'address[postcode]'], 'BN3 1AN');
$I->fillField('Phone', '0123456789');
$I->fillField('Emergency Contact', 'Contact Details');
$I->attachFile('Profile Photo', 'test-image.png');
$I->checkOption('rules_agreed');
//$userImageService = m::mock('\BB\Helpers\UserImage');
//$userImageService->shouldReceive('uploadPhoto')->times(1);
//$this->app->instance('\BB\Helpers\UserImage',$userImageService);
//$I->haveEnabledFilters();
$I->click('Join');
//Make sure we are now on an account page with the new id
$I->seeCurrentUrlMatches('^/account/(\\d+)^');
$user = \BB\Entities\User::where('email', '*****@*****.**')->first();
$I->assertNotEmpty($user->hash);
Exemplo n.º 3
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('add a meme');
$I->amOnPage('/');
$I->click('Dodaj');
$I->canSeeInCurrentUrl('/dodaj');
$I->see('Dodaj mem', 'h1');
$I->attachFile('#meme_image_file', 'testmeme.jpg');
$I->click('[type=submit]');
$I->see('Mem został dodany', 'h1');
//to be continued
Exemplo n.º 4
0
<?php

$I = new FunctionalTester($scenario);
$I->expectTo('have a usere in the database');
$I->haveRecord('users', ['username' => 'verem', 'password' => 'danverem', 'email' => '*****@*****.**', 'profile_state' => 0]);
$I->expectTo('have a logged in user');
$user = $I->grabRecord('users', ['username' => 'verem']);
$I->amLoggedAs(['username' => $user->username, 'id' => $user->id, 'password' => $user->password]);
$I->wantTo('test if chops is posting to database');
$I->amOnAction('ChopsController@create');
$I->seeInCurrentUrl('/create');
$I->see('What\'s that special meal you just ate today');
$I->fillField('name', 'edikaikong');
$I->attachFile('image', 'julia.jpeg');
$I->fillField('about', 'This food is the best dish in the country');
$I->click('submitButton');
$I->seeInCurrentUrl('/chops');
Exemplo n.º 5
0
<?php

$I = new FunctionalTester($scenario);
$I->wantTo('upload an image');
$I->amOnPage('/');
$I->attachFile('.upload', 'cookietest.jpg');
$I->fillField('Title', 'T is for Test');
$I->click('Upload');
$I->see('Uploading...');
$I->see('Upload Complete');
$I->seeRecord('images', array('filename' => 'cookietest.jpg', 'title' => 'T is for Test'));