Esempio n. 1
0
 /**
  * @param FunctionalTester $I
  */
 public function testUpdate(FunctionalTester $I)
 {
     $I->wantTo('ensure that create post-type works');
     $updatePage = UpdatePage::openBy($I);
     $I->see('Update Post Type: Post', 'h1');
     $I->amGoingTo('submit post-type form with correct data');
     $I->checkOption('#posttype-post_type_smb');
     $I->selectOption('#posttype-post_type_permission', 'subscriber');
     $updatePage->submitPostType(['post_type_description' => 'New post-type description']);
     $I->expectTo('post-type updated');
     // $I->see('View Post Type: Post', 'h1');
     $I->see('View Post Type: Post');
     PostType::findOne(1)->update(['post_type_smb' => '0', 'post_type_permission' => 'contributor', 'post_type_description' => '']);
     Taxonomy::deleteAll(['taxonomy_name' => 'test-taxonomy']);
 }
Esempio n. 2
0
 /**
  * @param AcceptanceTester $I
  */
 public function testUpdate(AcceptanceTester $I)
 {
     $I->wantTo('ensure that create post-type works');
     $updatePage = UpdatePage::openBy($I);
     $I->see('Update Post Type: Post', 'h1');
     // Only run for selenium
     if (method_exists($I, 'executeJS')) {
         $I->amGoingTo('submit taxonomy with no data');
         $updatePage->submitTaxonomy([]);
         $I->expectTo('see validation errors');
         $I->see('Name cannot be blank.', '.help-block');
         $I->see('Singular Name cannot be blank.', '.help-block');
         $I->see('Plural Name cannot be blank.', '.help-block');
         $I->amGoingTo('submit taxonomy with correct data');
         $updatePage->submitTaxonomy(['taxonomy_name' => 'test-taxonomy', 'taxonomy_sn' => 'Test Taxonomy', 'taxonomy_pn' => 'Test Taxonomies']);
         $I->expect('new taxonomy saved');
         $I->see('test-taxonomy', '#taxonomy_list');
         $I->dontSee('Name cannot be blank.', '.help-block');
         $I->dontSee('Singular Name cannot be blank.', '.help-block');
         $I->dontSee('Plural Name cannot be blank.', '.help-block');
     }
     // Test update data
     $I->amGoingTo('submit post-type form with correct data');
     $I->checkOption('#posttype-post_type_smb');
     $I->selectOption('#posttype-post_type_permission', 'subscriber');
     $updatePage->submitPostType(['post_type_description' => 'New post-type description']);
     $I->expectTo('post-type updated');
     $I->see('View Post Type: Post', 'h1');
     PostType::findOne(1)->update(['post_type_smb' => '0', 'post_type_permission' => 'contributor', 'post_type_description' => '']);
     Taxonomy::deleteAll(['taxonomy_name' => 'test-taxonomy']);
 }