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


PHP FunctionalTester::createProject方法代码示例

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


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

示例1: viewInvalidNote

 public function viewInvalidNote(FunctionalTester $I)
 {
     $I->am('Normal User');
     $I->expectTo('see 401 error with mismatch note route parameters.');
     $admin = $I->createUser(1, 4);
     // admin
     $project1 = $I->createProject(1, [$admin]);
     $project2 = $I->createProject(2, [$admin]);
     $note1 = $I->createNote(1, $admin, $project1);
     $I->amLoggedAs($admin);
     $I->amOnAction('ProjectController@getNotes', ['project' => $project1]);
     $uri = $I->getApplication()->url->action('ProjectController@postEditNote', ['project' => $project2, 'note' => $note1], false);
     $I->sendAjaxPostRequest($uri, ['body' => 'note one updated', '_token' => csrf_token()]);
     $I->seeResponseCodeIs(401);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:15,代码来源:OtherFunctionalCest.php

示例2: addIssue

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function addIssue(FunctionalTester $I)
 {
     $title = 'Issue 1';
     $body = 'Issue 1 description';
     $fileName = 'upload1.txt';
     $I->am('Manager User');
     $I->wantTo('add new issue to a project with attachment');
     $manager = $I->createUser(1, 3);
     $I->amLoggedAs($manager);
     $project = $I->createProject(1);
     $I->amOnAction('Project\\IssueController@getNew', ['project' => $project]);
     $uri = $I->getApplication()->url->action('Project\\IssueController@postUploadAttachment', ['project' => $project]);
     $I->submitFormWithFileToUri('#content .form-horizontal', $uri, ['upload' => $fileName], ['title' => $title, 'body' => $body]);
     $I->seeResponseCodeIs(200);
     $issue = $I->fetchIssueBy('title', $title);
     $I->seeCurrentActionIs('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->seeResponseCodeIs(200);
     $I->seeLink($title);
     $I->seeLink($fileName);
     $I->see($fileName, '.attachments');
     $I->see($body, '.content');
     $I->seeElement('.attachments a', ['title' => $fileName]);
     $attachment = $issue->attachments->first();
     $I->amOnAction('Project\\IssueController@getDisplayAttachment', ['project' => $project, 'issue' => $issue, 'attachment' => $attachment]);
     $I->seeResponseCodeIs(200);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:34,代码来源:CrudAttachmentCest.php

示例3: _createData

 /**
  * @param FunctionalTester $I
  * @param bool             $assignIssuesToDev
  *
  * @return array
  */
 protected function _createData(FunctionalTester $I, $assignIssuesToDev = false)
 {
     $manager = $I->createUser(1, 3);
     $developer = null;
     if ($assignIssuesToDev) {
         $developer = $I->createUser(2, 2);
     }
     $project = $I->createProject(1);
     $issues1 = [$I->createIssue(1, $manager, $developer, $project), $I->createIssue(11, $manager, $developer, $project)];
     $issues2 = [$I->createIssue(2, $manager, null, $project), $I->createIssue(21, $manager, null, $project), $I->createIssue(22, $manager, null, $project)];
     return [$manager, $project, $issues1, $issues2, $developer];
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:18,代码来源:ExportProjectIssueCest.php

示例4: viewOverview

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function viewOverview(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('To view administration overview page');
     $admin = $I->createUser(1, 4);
     $project1 = $I->createProject(1);
     $project2 = $I->createProject(2);
     $project2->status = Tinyissue\Model\Project::STATUS_ARCHIVED;
     $project2->save();
     $I->createProject(3);
     $I->createIssue(1, $admin, null, $project1);
     $I->createIssue(2, $admin, null, $project1);
     $issue3 = $I->createIssue(3, $admin, null, $project1);
     $issue3->changeStatus(Project\Issue::STATUS_CLOSED, $admin);
     $I->amLoggedAs($admin);
     $I->amOnAction('HomeController@getIndex');
     $I->click(trans('tinyissue.administration'));
     $I->seeCurrentActionIs('AdministrationController@getIndex');
     $I->see('1', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.total_users') . '\')]]/span');
     $I->see('2', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.active_projects') . '\')]]/span');
     $I->see('1', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.archived_projects') . '\')]]/span');
     $I->see('2', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.open_issues') . '\')]]/span');
     $I->see('1', '//li[@class="list-group-item" and text()[contains(.,\'' . trans('tinyissue.closed_issues') . '\')]]/span');
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:31,代码来源:AdministrationCest.php

示例5: deleteProject

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function deleteProject(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('delete an existing project details');
     $project = $I->createProject(1);
     $admin = $I->createUser(1, 4);
     $I->amLoggedAs($admin);
     $I->amOnAction('ProjectController@getEdit', ['project' => $project]);
     $I->click(trans('tinyissue.delete_something', ['name' => $project->name]));
     $I->seeCurrentActionIs('ProjectsController@getIndex');
     $I->dontSeeLink('Project 1');
     $I->amOnAction('ProjectsController@getIndex', ['status' => Project::STATUS_ARCHIVED]);
     $I->dontSeeLink('Project 1');
     $I->dontSeeRecord($project->getTable(), ['name' => 'Project 1']);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:22,代码来源:CrudProjectCest.php

示例6: assignToUser

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function assignToUser(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('not be able to assign an issue to a user');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $issue = $I->createIssue(1, $admin, null, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->dontSee($developer1->fullname, '.assigned-to .currently_assigned');
     $uri = $I->getApplication()->url->action('Project\\IssueController@postAssign', ['project' => $project]);
     $I->sendAjaxPostRequest($uri, ['user_id' => $developer1->id, '_token' => csrf_token()]);
     $I->comment($I->getResponseContent());
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->see($developer1->fullname, '.assigned-to .currently_assigned');
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:25,代码来源:IssueCest.php

示例7: deleteNote

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function deleteNote(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('delete an existing note from a project');
     $admin = $I->createUser(1, 4);
     $I->amLoggedAs($admin);
     $project = $I->createProject(1);
     $note1 = $I->createNote(1, $admin, $project);
     $note2 = $I->createNote(2, $admin, $project);
     $I->amOnAction('ProjectController@getNotes', ['project' => $project]);
     $I->see('Note 1', '//li[@id="note' . $note1->id . '"]');
     $I->see('Note 2', '//li[@id="note' . $note2->id . '"]');
     $uri = $I->getApplication()->url->action('ProjectController@getDeleteNote', ['project' => $project, 'note' => $note2]);
     $I->sendAjaxGetRequest($uri);
     $I->seeResponseCodeIs(200);
     $I->amOnAction('ProjectController@getNotes', ['project' => $project]);
     $I->see('Note 1', '//li[@id="note' . $note1->id . '"]');
     $I->dontSee('Note 2', '//li[@id="note' . $note2->id . '"]');
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:26,代码来源:CrudProjectNotesCest.php

示例8: deleteComment

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function deleteComment(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->wantTo('delete a comment from an issue');
     $admin = $I->createUser(2, 4);
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$admin]);
     $issue = $I->createIssue(1, $admin, $admin, $project);
     $comment1 = $I->createComment(1, $admin, $issue);
     $comment2 = $I->createComment(2, $admin, $issue);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->see($comment1->comment, '#comment' . $comment1->id . ' .content');
     $I->see($comment2->comment, '#comment' . $comment2->id . ' .content');
     $uri = $I->getApplication()->url->action('Project\\IssueController@getDeleteComment', ['comment' => $comment1]);
     $I->sendAjaxGetRequest($uri);
     $I->seeResponseCodeIs(200);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->dontSee($comment1->comment);
     $I->see($comment2->comment);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:27,代码来源:CrudIssueCommentCest.php

示例9: createNote

 /**
  * @param \FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function createNote(FunctionalTester $I)
 {
     $I->am('Manager User');
     $I->expectTo('be able to add notes to all projects');
     $user = $I->createUser(2, 3);
     $project1 = $I->createProject(1, [$user]);
     $project2 = $I->createProject(2);
     $I->amLoggedAs($user);
     $I->amOnAction('ProjectController@getNotes', ['project' => $project1]);
     $I->see(trans('tinyissue.add_note'));
     $I->sendPostRequest('ProjectController@postAddNote', ['project' => $project1], ['note_body' => 'Note 1', '_token' => csrf_token()]);
     $I->seeResponseCodeIs(200);
     $I->amOnAction('ProjectController@getNotes', ['project' => $project2]);
     $I->see(trans('tinyissue.add_note'));
     $I->sendPostRequest('ProjectController@postAddNote', ['project' => $project2], ['note_body' => 'Note 1', '_token' => csrf_token()]);
     $I->seeResponseCodeIs(200);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:24,代码来源:PermissionManagerCest.php

示例10: removeUserFromProject

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function removeUserFromProject(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('not be able to remove user to a project');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $I->amOnAction('ProjectController@getIndex', ['project' => $project]);
     $I->see($developer1->fullname, '#project-user' . $developer1->id);
     $uri = $I->getApplication()->url->action('ProjectController@postUnassign', ['project' => $project]);
     $I->sendAjaxPostRequest($uri, ['user_id' => $developer1->id, '_token' => csrf_token()]);
     $I->seeResponseCodeIs(200);
     $I->amOnAction('ProjectController@getIndex', ['project' => $project]);
     $I->dontSee($developer1->fullname, '#project-user' . $developer1->id);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:24,代码来源:ProjectCest.php

示例11: viewIssues

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function viewIssues(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->wantTo('view issues assigned to logged user in all projects');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     $I->amLoggedAs($developer1);
     $project1 = $I->createProject(1, [$developer1]);
     $issue1 = $I->createIssue(1, $admin, $developer1, $project1);
     $issue2 = $I->createIssue(2, $admin, $developer1, $project1);
     $issue3 = $I->createIssue(3, $developer1, $developer1, $project1);
     $project2 = $I->createProject(2, [$developer1]);
     $issue4 = $I->createIssue(4, $admin, $developer1, $project2);
     $issue5 = $I->createIssue(5, $admin, $developer1, $project2);
     $issue6 = $I->createIssue(6, $admin, null, $project2);
     $I->amOnAction('HomeController@getIndex');
     $I->click(trans('tinyissue.your_issues'));
     $I->seeLink($issue1->title);
     $I->seeLink($issue2->title);
     $I->seeLink($issue3->title);
     $I->seeLink($issue4->title);
     $I->seeLink($issue5->title);
     $I->dontSeeLink($issue6->title);
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:31,代码来源:UserCest.php

示例12: closeIssue

 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function closeIssue(FunctionalTester $I)
 {
     $I->am('Developer User');
     $I->wantTo('close an opened issue');
     $admin = $I->createUser(1, 4);
     $developer1 = $I->createUser(2, 2);
     // developer
     $I->amLoggedAs($admin);
     $project = $I->createProject(1, [$developer1]);
     $I->amOnAction('Project\\IssueController@getNew', ['project' => $project]);
     $issue = $I->createIssue(1, $admin, $developer1, $project);
     $I->amOnAction('Project\\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
     $I->click(trans('tinyissue.close_issue'), '.close-issue');
     $I->seeLink(trans('tinyissue.reopen_issue'));
     $I->click(trans('tinyissue.reopen_issue'));
     $I->dontSeeLink(trans('tinyissue.reopen_issue'));
     $I->seeLink(trans('tinyissue.close_issue'));
 }
开发者ID:oliverpool,项目名称:tinyissue,代码行数:25,代码来源:CrudIssueCest.php


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