You are here

public function BookUninstallValidatorTest::testValidateEntityQueryWithoutResults in Drupal 8

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

@covers ::validate

File

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

Class

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

Namespace

Drupal\Tests\book\Unit

Code

public function testValidateEntityQueryWithoutResults() {
  $this->bookUninstallValidator
    ->expects($this
    ->once())
    ->method('hasBookOutlines')
    ->willReturn(FALSE);
  $this->bookUninstallValidator
    ->expects($this
    ->once())
    ->method('hasBookNodes')
    ->willReturn(FALSE);
  $module = 'book';
  $expected = [];
  $reasons = $this->bookUninstallValidator
    ->validate($module);
  $this
    ->assertSame($expected, $this
    ->castSafeStrings($reasons));
}