Ejemplo n.º 1
0
 /**
  */
 public function testCreate()
 {
     /** @var EntityInterface|ObjectProphecy $entity */
     $entity = $this->prophesize('AppBundle\\Entity\\EntityInterface');
     $this->repository->create()->willReturn($entity->reveal())->shouldBeCalledTimes(1);
     $this->assertSame($entity->reveal(), $this->manager->create());
 }
 /**
  */
 public function testPost()
 {
     $method = 'POST';
     $parameters = array();
     /** @var FormInterface|ObjectProphecy $form */
     $form = $this->prophesize('Symfony\\Component\\Form\\FormInterface');
     /** @var EntityInterface|ObjectProphecy $submittedEntity */
     $submittedEntity = $this->prophesize('AppBundle\\Entity\\EntityInterface');
     /** @var EntityInterface|ObjectProphecy $entity */
     $entity = $this->prophesize('AppBundle\\Entity\\EntityInterface');
     $this->fertilizerObjectManager->create()->willReturn($entity->reveal())->shouldBeCalledTimes(1);
     $this->prophesizeProcessFormOk($entity, $method, $form, $parameters, $submittedEntity);
     $this->assertSame($submittedEntity->reveal(), $this->handler->post($parameters));
 }