Loading tests/src/Functional/PollBlockTest.php +5 −5 Changes for tests/src/Functional/PollBlockTest.php: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -37,10 +37,10 @@ class PollBlockTest extends PollTestBase { // If a 'block' view not generated, this title would not appear even though // the choices might. $this->assertText($poll->label()); $this->assertSession()->pageTextContains($poll->label()); $options = $poll->getOptions(); foreach ($options as $option) { $this->assertText($option); $this->assertSession()->pageTextContains($option); } // Verify we can vote via the block. Loading @@ -48,13 +48,13 @@ class PollBlockTest extends PollTestBase { 'choice' => '1', ); $this->drupalPostForm('user/' . $this->web_user->id(), $edit, t('Vote')); $this->assertText('Your vote has been recorded.'); $this->assertText('Total votes: 1'); $this->assertSession()->pageTextContains('Your vote has been recorded.'); $this->assertSession()->pageTextContains('Total votes: 1'); // Close the poll and verify block doesn't appear. $poll->close(); $poll->save(); $this->drupalGet('user/' . $user->id()); $this->assertNoText($poll->label()); $this->assertSession()->pageTextNotContains($poll->label()); } } tests/src/Functional/PollFieldUITest.php +11 −11 Changes for tests/src/Functional/PollFieldUITest.php: 11 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -40,24 +40,24 @@ class PollFieldUITest extends PollTestBase { $this->drupalLogin($this->admin_user); $this->drupalGet('admin/config/content/poll'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Check if 'Manage fields' tab appears in the poll's settings page. $this->assertUrl('admin/config/content/poll'); $this->assertSession()->addressEquals('admin/config/content/poll'); $xpath = '//div/main/aside/div/div/nav/ul/li[2]/a'; $this->assertFieldByXPath($xpath, 'Manage fields'); // Ensure that the 'Manage display' page is visible. $this->clickLink('Manage display'); $this->assertTitle('Manage display | Drupal'); $this->assertSession()->titleEquals('Manage display | Drupal'); // Ensure vote results in List $element = $this->cssSelect('#poll-votes'); $this->assertNotEqual($element, array(), '"Vote form/Results" field is available.'); $this->assertNotEquals($element, array(), '"Vote form/Results" field is available.'); // Ensure that the 'Manage fields' page is visible. $this->clickLink('Manage fields'); $this->assertTitle('Manage fields | Drupal'); $this->assertSession()->titleEquals('Manage fields | Drupal'); // Add a poll field. $this->clickLink('Add field'); Loading Loading @@ -91,26 +91,26 @@ class PollFieldUITest extends PollTestBase { $this->drupalGet('admin/help/poll'); $this->clickLink('Poll module'); $this->assertUrl('https://www.drupal.org/docs/contributed-modules/poll'); $this->assertSession()->addressEquals('https://www.drupal.org/docs/contributed-modules/poll'); $this->drupalGet('admin/help/poll'); $this->clickLink('Add a poll'); $this->assertUrl('poll/add'); $this->assertSession()->addressEquals('poll/add'); $this->drupalGet('admin/help/poll'); $this->clickLink('Polls', 0); $this->assertUrl('admin/content/poll'); $this->assertSession()->addressEquals('admin/content/poll'); $this->drupalGet('admin/help/poll'); $this->clickLink('Polls', 1); $this->assertUrl('admin/content/poll'); $this->assertSession()->addressEquals('admin/content/poll'); $this->drupalGet('admin/help/poll'); $this->clickLink('Blocks administration page'); $this->assertUrl('admin/structure/block'); $this->assertSession()->addressEquals('admin/structure/block'); $this->drupalGet('admin/help/poll'); $this->clickLink('Configure Poll permissions'); $this->assertUrl('admin/people/permissions#module-poll'); $this->assertSession()->pageTextContains('Access the Poll overview page'); } } Loading
tests/src/Functional/PollBlockTest.php +5 −5 Changes for tests/src/Functional/PollBlockTest.php: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -37,10 +37,10 @@ class PollBlockTest extends PollTestBase { // If a 'block' view not generated, this title would not appear even though // the choices might. $this->assertText($poll->label()); $this->assertSession()->pageTextContains($poll->label()); $options = $poll->getOptions(); foreach ($options as $option) { $this->assertText($option); $this->assertSession()->pageTextContains($option); } // Verify we can vote via the block. Loading @@ -48,13 +48,13 @@ class PollBlockTest extends PollTestBase { 'choice' => '1', ); $this->drupalPostForm('user/' . $this->web_user->id(), $edit, t('Vote')); $this->assertText('Your vote has been recorded.'); $this->assertText('Total votes: 1'); $this->assertSession()->pageTextContains('Your vote has been recorded.'); $this->assertSession()->pageTextContains('Total votes: 1'); // Close the poll and verify block doesn't appear. $poll->close(); $poll->save(); $this->drupalGet('user/' . $user->id()); $this->assertNoText($poll->label()); $this->assertSession()->pageTextNotContains($poll->label()); } }
tests/src/Functional/PollFieldUITest.php +11 −11 Changes for tests/src/Functional/PollFieldUITest.php: 11 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -40,24 +40,24 @@ class PollFieldUITest extends PollTestBase { $this->drupalLogin($this->admin_user); $this->drupalGet('admin/config/content/poll'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); // Check if 'Manage fields' tab appears in the poll's settings page. $this->assertUrl('admin/config/content/poll'); $this->assertSession()->addressEquals('admin/config/content/poll'); $xpath = '//div/main/aside/div/div/nav/ul/li[2]/a'; $this->assertFieldByXPath($xpath, 'Manage fields'); // Ensure that the 'Manage display' page is visible. $this->clickLink('Manage display'); $this->assertTitle('Manage display | Drupal'); $this->assertSession()->titleEquals('Manage display | Drupal'); // Ensure vote results in List $element = $this->cssSelect('#poll-votes'); $this->assertNotEqual($element, array(), '"Vote form/Results" field is available.'); $this->assertNotEquals($element, array(), '"Vote form/Results" field is available.'); // Ensure that the 'Manage fields' page is visible. $this->clickLink('Manage fields'); $this->assertTitle('Manage fields | Drupal'); $this->assertSession()->titleEquals('Manage fields | Drupal'); // Add a poll field. $this->clickLink('Add field'); Loading Loading @@ -91,26 +91,26 @@ class PollFieldUITest extends PollTestBase { $this->drupalGet('admin/help/poll'); $this->clickLink('Poll module'); $this->assertUrl('https://www.drupal.org/docs/contributed-modules/poll'); $this->assertSession()->addressEquals('https://www.drupal.org/docs/contributed-modules/poll'); $this->drupalGet('admin/help/poll'); $this->clickLink('Add a poll'); $this->assertUrl('poll/add'); $this->assertSession()->addressEquals('poll/add'); $this->drupalGet('admin/help/poll'); $this->clickLink('Polls', 0); $this->assertUrl('admin/content/poll'); $this->assertSession()->addressEquals('admin/content/poll'); $this->drupalGet('admin/help/poll'); $this->clickLink('Polls', 1); $this->assertUrl('admin/content/poll'); $this->assertSession()->addressEquals('admin/content/poll'); $this->drupalGet('admin/help/poll'); $this->clickLink('Blocks administration page'); $this->assertUrl('admin/structure/block'); $this->assertSession()->addressEquals('admin/structure/block'); $this->drupalGet('admin/help/poll'); $this->clickLink('Configure Poll permissions'); $this->assertUrl('admin/people/permissions#module-poll'); $this->assertSession()->pageTextContains('Access the Poll overview page'); } }