Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / node / tests / src / FunctionalJavascript / TestSettingSummariesContentType.php
1 <?php
2
3 namespace Drupal\Tests\node\FunctionalJavascript;
4
5 use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
6
7 /**
8  * Tests the JavaScript updating of summaries on content type form.
9  *
10  * @group node
11  */
12 class TestSettingSummariesContentType extends JavascriptTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['node'];
18
19   /**
20    * {@inheritdoc}
21    */
22   public function setUp() {
23     parent::setUp();
24
25     $admin_user = $this->drupalCreateUser(['administer content types']);
26     $this->drupalLogin($admin_user);
27     $this->drupalCreateContentType(['type' => 'test']);
28   }
29
30   /**
31    * Test a vertical tab 'Workflow' summary.
32    */
33   public function testWorkflowSummary() {
34     $this->drupalGet('admin/structure/types/manage/test');
35     $page = $this->getSession()->getPage();
36     $page->findField('options[status]')->uncheck();
37     $page->findField('options[sticky]')->check();
38     $page->findField('options[promote]')->check();
39     $page->findField('options[revision]')->check();
40     $locator = '[href="#edit-workflow"] .vertical-tabs__menu-item-summary';
41     $page->waitFor(10, function () use ($page, $locator) {
42       $summary = $page->find('css', $locator)->getText();
43       return strpos('Not published', $summary) !== FALSE;
44     });
45     $summary = $page->find('css', $locator)->getText();
46     $this->assertEquals('Not published, Promoted to front page, Sticky at top of lists, Create new revision', $summary);
47   }
48
49 }