當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FunctionalTester::attachFile方法代碼示例

本文整理匯總了PHP中FunctionalTester::attachFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP FunctionalTester::attachFile方法的具體用法?PHP FunctionalTester::attachFile怎麽用?PHP FunctionalTester::attachFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FunctionalTester的用法示例。


在下文中一共展示了FunctionalTester::attachFile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: submit

 /**
  * 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');
 }
開發者ID:rhamlet1,項目名稱:Hazid,代碼行數:16,代碼來源:FormPageFragment.php

示例2: FunctionalTester

<?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', 'jondoe2@example.com');
$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', 'jondoe2@example.com')->first();
$I->assertNotEmpty($user->hash);
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:28,代碼來源:SignUpCept.php

示例3: FunctionalTester

<?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
開發者ID:JarJak,項目名稱:MemeTreasury,代碼行數:12,代碼來源:AddMemeCept.php

示例4: FunctionalTester

<?php

$I = new FunctionalTester($scenario);
$I->expectTo('have a usere in the database');
$I->haveRecord('users', ['username' => 'verem', 'password' => 'danverem', 'email' => 'danverem@gmail.com', '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');
開發者ID:andela,項目名稱:chopbox,代碼行數:17,代碼來源:CreateChopsCept.php

示例5: FunctionalTester

<?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'));
開發者ID:bobseven,項目名稱:onimage-site,代碼行數:11,代碼來源:uploadCept.php


注:本文中的FunctionalTester::attachFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。