You are here

function CourseObjectTest::testCourseObjectConfigurations in Course 3.x

Test CourseObject configurations.

File

tests/src/Functional/CourseObjectTest.php, line 39

Class

CourseObjectTest
Tests Course objects

Namespace

Drupal\Tests\course\Functional

Code

function testCourseObjectConfigurations() {
  $courseNode = $this
    ->createCourse();
  $co1 = $this
    ->createCourseObject($courseNode);
  $co1
    ->setOption('test_option', 'FIND_ME');
  $co1
    ->save();
  $id = $co1
    ->id();
  $co2 = course_get_course_object_by_id($id);
  $this
    ->assertEqual($co2
    ->getOption('test_option'), 'FIND_ME', 'Check that options save and load successfully.');
}