You are here

public function BookUninstallValidatorTest::testValidateOutlineStorage in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/book/tests/src/Unit/BookUninstallValidatorTest.php \Drupal\Tests\book\Unit\BookUninstallValidatorTest::testValidateOutlineStorage()

@covers ::validate

File

core/modules/book/tests/src/Unit/BookUninstallValidatorTest.php, line 82

Class

BookUninstallValidatorTest
@coversDefaultClass \Drupal\book\BookUninstallValidator @group book

Namespace

Drupal\Tests\book\Unit

Code

public function testValidateOutlineStorage() {
  $this->bookUninstallValidator
    ->expects($this
    ->once())
    ->method('hasBookOutlines')
    ->willReturn(TRUE);
  $this->bookUninstallValidator
    ->expects($this
    ->never())
    ->method('hasBookNodes');
  $module = 'book';
  $expected = [
    'To uninstall Book, delete all content that is part of a book',
  ];
  $reasons = $this->bookUninstallValidator
    ->validate($module);
  $this
    ->assertEquals($expected, $reasons);
}