X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fforum%2Ftests%2Fsrc%2FUnit%2FBreadcrumb%2FForumListingBreadcrumbBuilderTest.php;fp=web%2Fcore%2Fmodules%2Fforum%2Ftests%2Fsrc%2FUnit%2FBreadcrumb%2FForumListingBreadcrumbBuilderTest.php;h=47a0113d1f8874a26e2688234eaa0b8983e7344b;hp=45566f2afe6d1f849060f808bf34e87354a83315;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php b/web/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php index 45566f2af..47a0113d1 100644 --- a/web/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php +++ b/web/core/modules/forum/tests/src/Unit/Breadcrumb/ForumListingBreadcrumbBuilderTest.php @@ -4,6 +4,7 @@ namespace Drupal\Tests\forum\Unit\Breadcrumb; use Drupal\Core\Cache\Cache; use Drupal\Core\Link; +use Drupal\taxonomy\TermStorageInterface; use Drupal\Tests\UnitTestCase; use Symfony\Component\DependencyInjection\Container; @@ -138,12 +139,12 @@ class ForumListingBreadcrumbBuilderTest extends UnitTestCase { $prophecy->getCacheMaxAge()->willReturn(Cache::PERMANENT); $term2 = $prophecy->reveal(); - $forum_manager = $this->getMock('Drupal\forum\ForumManagerInterface'); - $forum_manager->expects($this->at(0)) - ->method('getParents') + $term_storage = $this->getMockBuilder(TermStorageInterface::class)->getMock(); + $term_storage->expects($this->at(0)) + ->method('loadAllParents') ->will($this->returnValue([$term1])); - $forum_manager->expects($this->at(1)) - ->method('getParents') + $term_storage->expects($this->at(1)) + ->method('loadAllParents') ->will($this->returnValue([$term1, $term2])); // The root forum. @@ -167,6 +168,7 @@ class ForumListingBreadcrumbBuilderTest extends UnitTestCase { ->method('getStorage') ->will($this->returnValueMap([ ['taxonomy_vocabulary', $vocab_storage], + ['taxonomy_term', $term_storage], ])); $config_factory = $this->getConfigFactoryStub( @@ -177,6 +179,8 @@ class ForumListingBreadcrumbBuilderTest extends UnitTestCase { ] ); + $forum_manager = $this->getMock('Drupal\forum\ForumManagerInterface'); + // Build a breadcrumb builder to test. $breadcrumb_builder = $this->getMock( 'Drupal\forum\Breadcrumb\ForumListingBreadcrumbBuilder', NULL, [