You are here

public function OpignoWebTestCase::testCreateCourse in Opigno 7

File

tests/OpignoWebTestCase.test, line 37
Defines the base class for Opigno unit testing. This base class contains re-usable logic that will make it easier and faster to write Opigno-specific unit tests.

Class

OpignoWebTestCase
@file Defines the base class for Opigno unit testing. This base class contains re-usable logic that will make it easier and faster to write Opigno-specific unit tests.

Code

public function testCreateCourse() {
  $this
    ->drupalLogin($this->normal_user);
  $this
    ->drupalGet('node/add/course');
  $this
    ->assertText('You are not authorized to access this page.');
  $this
    ->drupalLogout();
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('node/add/course');
  $this
    ->assertText('Semi-public (registered users can subscribe to the course)');
  $course_content = array();
  $course_content['title'] = $this
    ->randomName(32);
  $course_content['body[und][0][value]'] = $this
    ->randomString(256);
  $course_content['group_access[und][1]'] = true;
  $this
    ->drupalPost('node/add/course', $course_content, t('Save'));
}