1 | <?php |
||
18 | class EntityManagerMock extends EntityManagerDecorator |
||
19 | { |
||
20 | /** |
||
21 | * @var \Doctrine\ORM\UnitOfWork|null |
||
22 | */ |
||
23 | private $uowMock; |
||
24 | |||
25 | /** |
||
26 | * @return EntityManagerInterface |
||
27 | */ |
||
28 | public function getWrappedEntityManager() : EntityManagerInterface |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function getUnitOfWork() |
||
40 | |||
41 | /** |
||
42 | * Sets a (mock) UnitOfWork that will be returned when getUnitOfWork() is called. |
||
43 | * |
||
44 | * @param \Doctrine\ORM\UnitOfWork $uow |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function setUnitOfWork($uow) |
||
52 | |||
53 | /** |
||
54 | * @return \Doctrine\ORM\Proxy\Factory\ProxyFactory |
||
55 | */ |
||
56 | public function getProxyFactory() |
||
60 | |||
61 | /** |
||
62 | * Mock factory method to create an EntityManager. |
||
63 | * |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public static function create($conn, Configuration $config = null, EventManager $eventManager = null) |
||
97 | } |
||
98 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: