Issue #2443653 by bzrudi71, tstoeckler, daffie: PostgreSQL: Fix system\Tests\Condition\ConditionFormTest

8.0.x
webchick 2015-03-07 09:56:24 +11:00
parent 5ad41abb9d
commit 6238aabe9e
2 changed files with 7 additions and 3 deletions

View File

@ -34,7 +34,9 @@ class ConditionFormTest extends WebTestBase {
$this->assertField('bundles[article]', 'There is an article bundle selector.');
$this->assertField('bundles[page]', 'There is a page bundle selector.');
$this->drupalPostForm(NULL, array('bundles[page]' => 'page', 'bundles[article]' => 'article'), t('Submit'));
$this->assertText('The bundles are article and page', 'The form component appropriately saved the bundles.');
// @see \Drupal\condition_test\FormController::submitForm()
$this->assertText('Bundle: page');
$this->assertText('Bundle: article');
$this->assertText('Executed successfully.', 'The form configured condition executed properly.');
}

View File

@ -65,8 +65,10 @@ class FormController implements FormInterface {
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->condition->submitConfigurationForm($form, $form_state);
$config = $this->condition->getConfig();
$bundles = implode(' and ', $config['bundles']);
drupal_set_message(t('The bundles are @bundles', array('@bundles' => $bundles)));
foreach ($config['bundles'] as $bundle) {
drupal_set_message('Bundle: ' . $bundle);
}
$article = Node::load(1);
$this->condition->setContextValue('node', $article);
if ($this->condition->execute()) {