public function ForumUninstallValidatorTest::testValidate in Drupal 9
Same name and namespace in other branches
- 8 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 51
Class
- ForumUninstallValidatorTest
- @coversDefaultClass \Drupal\forum\ForumUninstallValidator @group forum
Namespace
Drupal\Tests\forum\UnitCode
public function testValidate() {
$this->forumUninstallValidator
->expects($this
->once())
->method('hasForumNodes')
->willReturn(FALSE);
$vocabulary = $this
->createMock('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
->assertEquals($expected, $reasons);
}