You are here

CourseNodeTest.php in Course 3.x

File

modules/course_node/tests/src/Functional/CourseNodeTest.php
View source
<?php

namespace Drupal\Tests\course_node\Functional;

use Drupal\Tests\course\Functional\CourseTestBase;

/**
 * Test course node functionality.
 *
 * @group course
 */
class CourseNodeTest extends CourseTestBase {
  protected static $modules = [
    'course_node',
  ];
  function testCourseNode() {
    $this
      ->drupalLogin($this->admin_user);
    $this
      ->drupalGet("node/add/course");
    $this
      ->submitForm([
      'title[0][value]' => 'Course page title 1',
      'course[form][0][title][0][value]' => 'Course title 1',
    ], t('Save'));
    $this
      ->drupalLogin($this->student_user);
    $this
      ->drupalGet('node/1');
    $this
      ->clickLink('Course title 1');
    $this
      ->clickLink('Take course');
    $this
      ->clickLink('Complete');
  }

}

Classes

Namesort descending Description
CourseNodeTest Test course node functionality.