You are here

public function ForumUninstallValidatorTest::testValidate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php \Drupal\Tests\forum\Unit\ForumUninstallValidatorTest::testValidate()

@covers ::validate

File

core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php, line 58
Contains \Drupal\Tests\forum\Unit\ForumUninstallValidatorTest.

Class

ForumUninstallValidatorTest
@coversDefaultClass \Drupal\forum\ForumUninstallValidator @group forum

Namespace

Drupal\Tests\forum\Unit

Code

public function testValidate() {
  $this->forumUninstallValidator
    ->expects($this
    ->once())
    ->method('hasForumNodes')
    ->willReturn(FALSE);
  $vocabulary = $this
    ->getMock('Drupal\\taxonomy\\VocabularyInterface');
  $this->forumUninstallValidator
    ->expects($this
    ->once())
    ->method('getForumVocabulary')
    ->willReturn($vocabulary);
  $this->forumUninstallValidator
    ->expects($this
    ->once())
    ->method('hasTermsForVocabulary')
    ->willReturn(FALSE);
  $module = 'forum';
  $expected = [];
  $reasons = $this->forumUninstallValidator
    ->validate($module);
  $this
    ->assertSame($expected, $this
    ->castSafeStrings($reasons));
}