diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index 1e0a48f..6c964db 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -117,7 +117,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti // Make sure there are no active blocks for these feeds. $context_ids = []; foreach ($entities as $key => $entity) { - $context_ids[$key] = 'aggregator.feed:' . $entity->uuid(); + $context_ids[$key] = '@aggregator.feed_context:' . $entity->uuid(); } $ids = \Drupal::entityQuery('block') ->condition('plugin', 'aggregator_feed_block') diff --git a/core/modules/aggregator/src/Tests/DeleteFeedTest.php b/core/modules/aggregator/src/Tests/DeleteFeedTest.php index e155584..f40be04 100644 --- a/core/modules/aggregator/src/Tests/DeleteFeedTest.php +++ b/core/modules/aggregator/src/Tests/DeleteFeedTest.php @@ -30,10 +30,10 @@ public function testDeleteFeed() { // Place a block for both feeds. $block = $this->drupalPlaceBlock('aggregator_feed_block'); - $block->getPlugin()->setContextMapping(['feed' => 'aggregator.feed:' . $feed1->uuid()]); + $block->getPlugin()->setContextMapping(['feed' => '@aggregator.feed_context:' . $feed1->uuid()]); $block->save(); $block2 = $this->drupalPlaceBlock('aggregator_feed_block'); - $block2->getPlugin()->setContextMapping(['feed' => 'aggregator.feed:' . $feed2->uuid()]); + $block2->getPlugin()->setContextMapping(['feed' => '@aggregator.feed_context:' . $feed2->uuid()]); $block2->save(); // Delete feed. diff --git a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php index d837848..5ddeab0 100644 --- a/core/modules/block/tests/src/Unit/BlockRepositoryTest.php +++ b/core/modules/block/tests/src/Unit/BlockRepositoryTest.php @@ -40,6 +40,11 @@ class BlockRepositoryTest extends UnitTestCase { protected $contextHandler; /** + * @var \Drupal\Core\Plugin\Context\LazyContextRepository|\PHPUnit_Framework_MockObject_MockObject + */ + protected $contextRepository; + + /** * {@inheritdoc} */ protected function setUp() { @@ -65,13 +70,16 @@ protected function setUp() { ->will($this->returnValue($active_theme)); $this->contextHandler = $this->getMock('Drupal\Core\Plugin\Context\ContextHandlerInterface'); + $this->contextRepository = $this->getMockBuilder('Drupal\Core\Plugin\Context\LazyContextRepository') + ->disableOriginalConstructor() + ->getMock(); $this->blockStorage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface'); $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $entity_manager->expects($this->any()) ->method('getStorage') ->willReturn($this->blockStorage); - $this->blockRepository = new BlockRepository($entity_manager, $theme_manager, $this->contextHandler); + $this->blockRepository = new BlockRepository($entity_manager, $theme_manager, $this->contextHandler, $this->contextRepository); } /**