You are here

public function ArticleCreationTest::testCreateArticleWithNoModeration in Thunder 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ArticleCreationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ArticleCreationTest::testCreateArticleWithNoModeration()
  2. 8.2 tests/src/FunctionalJavascript/ArticleCreationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ArticleCreationTest::testCreateArticleWithNoModeration()
  3. 8.3 tests/src/FunctionalJavascript/ArticleCreationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ArticleCreationTest::testCreateArticleWithNoModeration()
  4. 6.2.x tests/src/FunctionalJavascript/ArticleCreationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ArticleCreationTest::testCreateArticleWithNoModeration()
  5. 6.0.x tests/src/FunctionalJavascript/ArticleCreationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ArticleCreationTest::testCreateArticleWithNoModeration()
  6. 6.1.x tests/src/FunctionalJavascript/ArticleCreationTest.php \Drupal\Tests\thunder\FunctionalJavascript\ArticleCreationTest::testCreateArticleWithNoModeration()

Test Creation of Article without content moderation.

File

tests/src/FunctionalJavascript/ArticleCreationTest.php, line 125

Class

ArticleCreationTest
Tests the article creation.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function testCreateArticleWithNoModeration() {

  // Delete all the articles so we can disable content moderation.
  foreach (\Drupal::entityTypeManager()
    ->getStorage('node')
    ->loadByProperties([
    'type' => 'article',
  ]) as $node) {
    $node
      ->delete();
  }
  \Drupal::service('module_installer')
    ->uninstall([
    'content_moderation',
  ]);

  // Try to create an article.
  $this
    ->articleFillNew([
    'field_channel' => 1,
    'title[0][value]' => 'Test article',
    'field_seo_title[0][value]' => 'Massive gaining seo traffic text',
  ]);
  $this
    ->clickSave();
  $this
    ->assertPageTitle('Massive gaining seo traffic text');
  $this
    ->assertSession()
    ->pageTextContains('Test article');
}