Created
August 5, 2016 19:13
-
-
Save amitaibu/7342c16b55191fda27bd02063c0da866 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $this->entityManager->getStorage('og_membership') | |
// ->willReturn($this->entityStorage->reveal()); | |
// | |
// $this->entityManager->getEntityTypeFromClass('Drupal\og\Entity\OgMembership') | |
// ->willReturn('og_membership'); | |
// | |
// // Create a mocked Og Membership entity. | |
// $membership_entity = $this->prophesize(OgMembershipInterface::class); | |
// | |
// $this->entityStorage | |
// ->create(Argument::type('array')) | |
// ->willReturn($membership_entity->reveal()); | |
// | |
// // Create a mocked test group. | |
// $this->group = $this->prophesize(EntityInterface::class); | |
// | |
// // Create a mocked test user. | |
// $this->user = $this->prophesize(AccountInterface::class); | |
// | |
// $membership_entity | |
// ->setUser($this->user) | |
// ->willReturn($membership_entity->reveal()); | |
// | |
// $membership_entity | |
// ->setGroup($this->group) | |
// ->willReturn($membership_entity->reveal()); | |
// | |
// $container = new ContainerBuilder(); | |
// $container->set('entity.manager', $this->entityManager->reveal()); | |
// \Drupal::setContainer($container); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment