/** * @param AcceptanceTester $I */ public function testUpdate(AcceptanceTester $I) { $I->wantTo('ensure that update taxonomy works'); $updateTaxonomy = UpdatePage::openBy($I); $I->see('Update Taxonomy: Tag', 'h1'); $I->amGoingTo('submit update taxonomy form with correct data'); $updateTaxonomy->submit(['singular_name' => 'New Taxonomy', 'plural_name' => 'New Taxonomies']); $I->expect('taxonomy updated'); $I->see('View Taxonomy: New Taxonomy'); $I->seeElement('#term-parent'); Taxonomy::findOne(2)->update(['hierarchical' => '0', 'menu_builder' => '0', 'singular_name' => 'Tag', 'plural_name' => 'Tags']); }
/** * @param AcceptanceTester $I */ public function testUpdate(AcceptanceTester $I) { $I->wantTo('ensure that update taxonomy works'); $updateTaxonomy = UpdatePage::openBy($I); $I->see('Update Taxonomy: Tag', 'h1'); $I->amGoingTo('submit update taxonomy form with correct data'); $updateTaxonomy->submit(['taxonomy_sn' => 'New Taxonomy']); $I->expect('taxonomy updated'); $I->see('View Taxonomy: New Taxonomy'); $I->seeElement('#term-term_parent'); Taxonomy::findOne(2)->update(['taxonomy_hierarchical' => '0', 'taxonomy_smb' => '0']); }
/** * Lists all Taxonomy models. * * @return mixed */ public function actionIndex() { $searchModel = new TaxonomySearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * @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']); }
/** * @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']); }