You are here

public function OpignoSimpleUIQuizTest::testQuizForm in Opigno 7.0

File

modules/opigno_simple_ui/tests/opigno_simple_ui.quiz.test, line 32
Check Quiz overrides.

Class

OpignoSimpleUIQuizTest
@file Check Quiz overrides.

Code

public function testQuizForm() {
  if ($this
    ->_checkDependency('quiz') || $this
    ->_checkDependency('quiz_question') || $this
    ->_checkDependency('multichoice')) {
    $this
      ->drupalLogin($this->admin);
    $gid = $this
      ->_createQuiz();
    $this
      ->assertNoText('Browse for questions to add');
    $this
      ->assertText('Browse existing questions to add them to this quiz', 'Changed label of fieldset for browsing questions.');
    $matches = array();
    preg_match('/node\\/([0-9]+)\\/questions$/', $this
      ->getURL(), $matches);
    $this
      ->drupalGET('node/' . $matches[1]);

    // Should not be any "Manage questions" tab
    $this
      ->assertNoLink('Manage questions', 'Should be no "Manage questions" tab.');
    $this
      ->clickLink('Edit');
    $this
      ->assertLink('Manage questions', 0, 'The "Manage questions" link should be a sub tab for the node edit form.');
  }
}