X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FCondition%2FConditionFormTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FCondition%2FConditionFormTest.php;h=adefc4392e620dbba4ae3b6f0eed63ded38a5c3f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=0000000000000000000000000000000000000000;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php b/web/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php new file mode 100644 index 000000000..adefc4392 --- /dev/null +++ b/web/core/modules/system/tests/src/Functional/Condition/ConditionFormTest.php @@ -0,0 +1,44 @@ +drupalCreateContentType(['type' => 'page', 'name' => 'Page']); + $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']); + + $article = Node::create([ + 'type' => 'article', + 'title' => $this->randomMachineName(), + ]); + $article->save(); + + $this->drupalGet('condition_test'); + $this->assertField('bundles[article]', 'There is an article bundle selector.'); + $this->assertField('bundles[page]', 'There is a page bundle selector.'); + $this->drupalPostForm(NULL, ['bundles[page]' => 'page', 'bundles[article]' => 'article'], t('Submit')); + // @see \Drupal\condition_test\FormController::submitForm() + $this->assertText('Bundle: page'); + $this->assertText('Bundle: article'); + $this->assertText('Executed successfully.', 'The form configured condition executed properly.'); + } + +}