entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class); $this->entityTypeRepository = $this->prophesize(EntityTypeRepositoryInterface::class); $this->entityTypeBundleInfo = $this->prophesize(EntityTypeBundleInfoInterface::class); $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class); $container = new ContainerBuilder(); $container->set('entity_type.manager', $this->entityTypeManager->reveal()); $container->set('entity_type.repository', $this->entityTypeRepository->reveal()); $container->set('entity_type.bundle.info', $this->entityTypeBundleInfo->reveal()); $container->set('entity_field.manager', $this->entityFieldManager->reveal()); $this->entityManager = new EntityManager(); $this->entityManager->setContainer($container); } /** * Tests the clearCachedDefinitions() method. * * @covers ::clearCachedDefinitions */ public function testClearCachedDefinitions() { $this->entityTypeManager->clearCachedDefinitions()->shouldBeCalled(); $this->entityTypeRepository->clearCachedDefinitions()->shouldBeCalled(); $this->entityTypeBundleInfo->clearCachedBundles()->shouldBeCalled(); $this->entityFieldManager->clearCachedFieldDefinitions()->shouldBeCalled(); $this->entityManager->clearCachedDefinitions(); } }