Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function testDeleting() |
||
17 | { |
||
18 | $id = 241; |
||
19 | $f1 = new AbcClass(); |
||
20 | |||
21 | $evm = $this->prophesize(EventDispatcherInterface::class); |
||
22 | $evm->dispatch(CrudEvents::DELETE, Argument::type(CollectionCrudEvent::class))->shouldBeCalled(); |
||
23 | |||
24 | $repository = $this->prophesize(ObjectRepository::class); |
||
25 | $repository->find(Argument::exact($id))->willReturn($f1)->shouldBeCalled(); |
||
26 | |||
27 | $manager = $this->prophesize(ObjectManager::class); |
||
28 | $manager->remove(Argument::exact($f1))->shouldBeCalled(); |
||
29 | $manager->flush()->shouldBeCalled(); |
||
30 | |||
31 | $controller = new DeleteController($repository->reveal(), $manager->reveal(), $evm->reveal()); |
||
32 | $controller->deleteAction($id); |
||
33 | } |
||
34 | } |
||
35 |