You are here

function CourseObjectTestCase::testCourseObjectConstruction in Course 7.2

Same name and namespace in other branches
  1. 6 tests/CourseObjectTestCase.test \CourseObjectTestCase::testCourseObjectConstruction()
  2. 7 tests/CourseObjectTestCase.test \CourseObjectTestCase::testCourseObjectConstruction()

Test the construction of CourseObjects.

File

tests/CourseObjectTestCase.test, line 59

Class

CourseObjectTestCase
Description of CourseObjectTestCase

Code

function testCourseObjectConstruction() {
  $courseNode = $this
    ->createCourseNode();
  $this
    ->createCourseObject($courseNode);
  $course = course_get_course($courseNode);
  $courseObjects = array_values($course
    ->getObjects());
  $courseObject = reset($courseObjects);
  $getCourse = $courseObject
    ->getCourse();
  $this
    ->assertEqual(spl_object_hash($course), spl_object_hash($getCourse), 'Check that Courses inside of CourseObjects inside of Course are the same.');
}