当前位置: 首页>>代码示例>>PHP>>正文


PHP AcceptanceTester::go方法代码示例

本文整理汇总了PHP中AcceptanceTester::go方法的典型用法代码示例。如果您正苦于以下问题:PHP AcceptanceTester::go方法的具体用法?PHP AcceptanceTester::go怎么用?PHP AcceptanceTester::go使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AcceptanceTester的用法示例。


在下文中一共展示了AcceptanceTester::go方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that User create work');
// ADMIN
$I->login();
$I->go(['/user/user/create']);
$I->testForm('#user-form', 'User', [], ['username' => 'admin', 'owner_id' => 'asd', 'email' => 123, 'phone' => 'DN', 'password' => '', 'notify' => 'DN', 'permissions[]' => 'uploader']);
$I->testForm('#user-form', 'User', ['username' => 'test', 'owner_id' => '1', 'email' => 'test@test.test', 'phone' => '+79125675656', 'password' => 'admin', 'notify' => '1', 'permissions[]' => 'partner']);
$I->seeElement('.alert-success');
//CUSTOMER
$I->customerLogin();
$I->go(['/user/user/create']);
$I->testForm('#user-form', 'User', [], ['username' => 'admin', 'owner_id' => 3, 'email' => 123, 'phone' => 'DN', 'password' => '', 'notify' => 'DN', 'permissions[]' => 'root']);
$I->testForm('#user-form', 'User', ['username' => 'test1', 'owner_id' => '2', 'email' => 'test1@test1.test1', 'phone' => '+79125675656', 'password' => 'admin', 'notify' => '1', 'permissions[]' => 'partner']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:16,代码来源:02_UserCept.php

示例2: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Notice create works');
// ADMIN
$I->login();
$I->go(['/notice/item/create']);
// wrong data
$I->testForm('#notice-form', 'Item', [], ['owner_id' => 123, 'users[]' => 123, 'partners[]' => 123, 'message' => '', 'date_from' => '28/12/2015', 'date_to' => '2015-12-28']);
// correct data
$I->testForm('#notice-form', 'Item', ['owner_id' => 1, 'partners[]' => 2, 'users[]' => 3, 'message' => 'test message', 'date_from' => '2015-10-10', 'date_to' => '2015-10-10']);
$I->seeElement('.alert-success');
// CUSTOMER
$I->customerLogin();
$I->go(['/notice/item/create']);
// wrong data
$I->testForm('#notice-form', 'Item', ['owner_id' => 123], ['users[]' => 1, 'partners[]' => 3, 'message' => '', 'date_from' => '28/12/2015', 'date_to' => '2015-12-28']);
// correct data
$I->testForm('#notice-form', 'Item', ['partners[]' => 2, 'users[]' => 3, 'message' => 'test message', 'date_from' => '2015-10-10', 'date_to' => '2015-10-10']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:20,代码来源:08_NoticeCept.php

示例3: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Campaign create works');
// ADMIN
$I->customerLogin();
$I->go(['/campaign/item/create']);
// wrong data
$I->testForm('#campaign-form', 'Item', ['owner_id' => 123], ['partner_type' => 123, 'title' => '', 'partners[]' => 3, 'date_start' => '28/12/2015', 'date_end' => '2015-12-28', 'date_delivery' => '2015-12-30']);
// correct data
$I->testForm('#campaign-form', 'Item', ['partner_type' => 0, 'title' => 'test campaign', 'partners[]' => 2, 'date_start' => date('Y-m-d'), 'date_end' => date('Y-m-d', strtotime('+5days')), 'date_delivery' => date('Y-m-d')]);
$I->seeElement('.alert-success');
$updateUrl = $I->getUrl();
$id = preg_replace('/.*(\\d+)/', '$1', $updateUrl);
// ADDING TEMPLATE
$I->click('.template-add-link');
// I am on template select page
$I->click('template 1');
// I am on template add form
$I->testForm('form', 'Template', [], ['partners[]' => 1]);
$I->testForm('form', 'Template', ['partners[]' => 2]);
// I am on template view page
$I->go($updateUrl);
// I see added template in campaign
$I->see('template 1', 'strong');
// ADDING MATERIAL
$I->click('.material-add-button');
// I am on material add page
$I->click('.material-add-image');
// I am on material add page
$I->testForm('#material-form', 'Material', [], ['title' => '']);
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:31,代码来源:09_CampaignCept.php

示例4: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Campaign create works');
$updateUrl = ['/campaign/partner-item/update', 'id' => 1];
// CUSTOMER
$I->customerLogin();
$I->go($updateUrl);
$I->seeElement('.alert-danger');
// partner campaign waits for partner to approve it
// PARTNER
$I->partnerLogin();
$I->go($updateUrl);
// ADDING MATERIAL
$I->click('.material-add-button');
// I am on material add page
$I->click('.material-add-image');
// I am on material add page
// wrong data
$I->testMultipleForm('#material-form', ['Material' => ['correct' => ['owner_id' => 'asd'], 'wrong' => ['title' => '']], 'MaterialRule[new-0]' => ['correct' => ['rule_id' => 1], 'wrong' => ['operator' => '<<', 'value' => '']]]);
// correct data
$I->testMultipleForm('#material-form', ['Material' => ['correct' => ['title' => 'partner test material', 'description' => 'partner test description'], 'wrong' => []], 'MaterialRule[new-0]' => ['correct' => ['rule_id' => 1, 'operator' => '=', 'value' => 'Mercedes'], 'wrong' => []]]);
// UPDATE partner campaign
$I->go($updateUrl);
$I->seeElement('#material-view-' . \app\modules\campaign\models\Material::find()->max('id'));
$I->testForm('#partner-campaign-form', 'PartnerItem', [], ['status' => \app\modules\campaign\models\PartnerItem::STATUS_ACCEPT]);
$I->testForm('#partner-campaign-form', 'PartnerItem', ['status' => \app\modules\campaign\models\PartnerItem::STATUS_READY]);
$I->seeElement('.alert-success');
$I->go($updateUrl);
$I->seeElement('.alert-danger');
// now partner has to wait for customer to approve
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:31,代码来源:10_PartnerCampaignCept.php

示例5: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Material create works');
// CUSTOMER
$I->customerLogin();
$I->go(['/material/item/create']);
// wrong data
$I->attachFile('#item-file', 'mmc.pdf');
// small dpi
$I->testForm('#item-form', 'Item', [], ['file' => 123, 'type' => 123, 'owner_id' => 3, 'valid_from' => '28/12/2015', 'valid_to' => '2015-12-28']);
// correct data
$I->attachFile('#item-file', 'material.jpg');
$I->testForm('#item-form', 'Item', ['file' => 'material.jpg', 'type' => 0, 'owner_id' => 2, 'description' => 'asdasd', 'valid_from' => date('Y-m-d'), 'valid_to' => date('Y-m-d')]);
$I->seeElement('.alert-success');
// CUSTOMER
$I->partnerLogin();
$I->go(['/material/item/create']);
// wrong data
$I->attachFile('#item-file', 'mmc.pdf');
// small dpi
$I->testForm('#item-form', 'Item', ['owner_id' => 123], ['file' => 123, 'type' => 123, 'valid_from' => '28/12/2015', 'valid_to' => '2015-12-28']);
// correct data
$I->attachFile('#item-file', 'material.jpg');
$I->testForm('#item-form', 'Item', ['file' => 'material.jpg', 'type' => 0, 'description' => 'asdasd', 'valid_from' => date('Y-m-d'), 'valid_to' => date('Y-m-d')]);
$I->seeElement('.alert-success');
// PARTNER
// no upload role
$partner = \bariew\yii2Tools\tests\FixtureManager::get('user_user', 'test_partner1');
$I->login($partner->username, 'admin');
$I->go(['/material/item/create']);
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:31,代码来源:07_MaterialCept.php

示例6: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Section create works');
// ADMIN
$I->login();
$I->go(['/template/section/create']);
$I->testForm('#section-form', 'Section', [], ['title' => '', 'status' => 123, 'type' => 123, 'width' => 'asd', 'height' => 'asd', 'material_max' => 'asd', 'price' => 'asd']);
$I->testForm('#section-form', 'Section', ['title' => 'Test section', 'status' => 0, 'type' => 0, 'templates[]' => '1', 'description' => 'test descr', 'width' => 100, 'height' => 100, 'material_max' => 3, 'price' => 100, 'price_comment' => 'test comment']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:10,代码来源:04_SectionCept.php

示例7: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Rule create works');
// ADMIN
$I->login();
$I->go(['/template/rule/index']);
// index page
$I->testForm('#rule-create-form', 'RuleSearch', ['owner_id' => 2, 'partner_type' => 1]);
$I->seeElement('.alert-danger');
$I->testForm('#rule-create-form', 'RuleSearch', ['owner_id' => 1, 'partner_type' => 0]);
// form page
// wrong data
$I->testForm('#rule-form', 'Rule', ['owner_id' => 1, 'partner_type' => 0], ['title' => '', 'form_type' => 123, 'field' => 123, 'values' => 'some wrong parsed string']);
$I->testForm('#rule-form', 'Rule', ['owner_id' => 1, 'partner_type' => 0, 'form_type' => 2], ['title' => '', 'field' => '', 'values' => '']);
// correct data
$I->testForm('#rule-form', 'Rule', ['owner_id' => 1, 'partner_type' => 0, 'title' => 'Test rule', 'form_type' => 2, 'field' => 'car_brand', 'values' => "1=option1;1\n2=option2;0", 'sections[]' => '1']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:18,代码来源:05_RuleCept.php

示例8: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that company create work');
// ADMIN
$I->login();
$I->go(['/user/company/create']);
$I->testForm('#company-form', 'Company', [], ['title' => 'EXAMPLE', 'owner_id' => 'asd', 'type' => 123, 'outer_id' => 'DN']);
$I->testForm('#company-form', 'Company', ['title' => 'new title', 'owner_id' => '1', 'type' => 0, 'outer_id' => 'AS']);
$I->seeElement('.alert-success');
//CUSTOMER
$I->customerLogin();
$I->go(['/user/company/create']);
$I->testForm('#company-form', 'Company', [], ['title' => 'EXAMPLE', 'type' => 123, 'outer_id' => 'DN']);
$I->testForm('#company-form', 'Company', ['title' => 'new title customer', 'type' => 0, 'outer_id' => 'AS1']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:16,代码来源:01_CompanyCept.php

示例9: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that Template create work');
// ADMIN
$I->login();
$I->go(['/template/item/create']);
$I->testForm('#item-form', 'Item', [], ['title' => '', 'status' => 123, 'type' => 123, 'partner_type' => 123]);
$I->testForm('#item-form', 'Item', ['title' => 'test title', 'status' => 0, 'type' => 0, 'partner_type' => 0, 'customers[]' => '1', 'sections[]' => '1', 'description' => 'test descr']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:10,代码来源:03_TemplateCept.php

示例10: AcceptanceTester

<?php

$I = new AcceptanceTester($scenario);
$I->wantTo('ensure that SectionPreview create works');
// ADMIN
$I->login();
$I->go(['/template/section-preview/create']);
// wrong data
$I->attachFile('#sectionpreview-file', 'mmc.pdf');
$I->testForm('#preview-form', 'SectionPreview', [], ['file' => 123, 'owner_id' => 123, 'img_width' => 'asd', 'img_height' => 'sdf', 'img_top' => '', 'img_left' => '', 'section_content' => '', 'material_content' => '']);
// correct data
$I->attachFile('#sectionpreview-file', 'template_background.png');
$I->testForm('#preview-form', 'SectionPreview', ['owner_id' => 2, 'sections[]' => 1, 'img_width' => '756', 'img_height' => '410', 'img_top' => '702', 'img_left' => '19', 'section_content' => 'Section content', 'material_content' => 'Material content']);
$I->seeElement('.alert-success');
开发者ID:bariew,项目名称:yii2-cms-project,代码行数:14,代码来源:06_PreviewCept.php


注:本文中的AcceptanceTester::go方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。