You are here

function CourseNodeTestCase::testCourseNode in Course 8.2

Same name and namespace in other branches
  1. 8.3 modules/course_node/tests/src/Functional/CourseNodeTest.php \Drupal\Tests\course_node\Functional\CourseNodeTestCase::testCourseNode()

File

modules/course_node/tests/src/Functional/CourseNodeTest.php, line 16

Class

CourseNodeTestCase
Test course node functionality.

Namespace

Drupal\Tests\course_node\Functional

Code

function testCourseNode() {
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet("node/add/course");
  $this
    ->drupalPostForm(NULL, [
    'title[0][value]' => 'Course page title 1',
    'course[form][inline_entity_form][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');
}