You are here

function CourseOutlineUiTest::testDeleteCourse in Course 3.x

Test that a course can be deleted.

File

tests/src/Functional/CourseOutlineUiTest.php, line 71

Class

CourseOutlineUiTest
Test class for dealing with adding and removing elements from the course outline.

Namespace

Drupal\Tests\course\Functional

Code

function testDeleteCourse() {
  $course = $this
    ->createCourse([
    'title' => 'Course 1',
  ]);
  $this
    ->drupalGet("course/{$course->id()}/delete");
  $this
    ->drupalPostForm(NULL, [], t('Delete'));
  $this
    ->assertSession()
    ->pageTextContains('The course Course 1 has been deleted.');
}