@@ 44-65 (lines=22) @@ | ||
41 | /** |
|
42 | * @return \Doctrine\ORM\EntityManager |
|
43 | */ |
|
44 | protected function getMockedEntityManager() |
|
45 | { |
|
46 | $configuration = Stub::make(Configuration::class, [ |
|
47 | 'getQuoteStrategy' => null |
|
48 | ]); |
|
49 | ||
50 | $repository = Stub::make(EntityRepository::class, [ |
|
51 | 'find' => null, |
|
52 | 'findBy' => null, |
|
53 | 'findOneBy' => null, |
|
54 | ]); |
|
55 | /** @var \Doctrine\ORM\EntityManager $emMock */ |
|
56 | $emMock = Stub::make(EntityManager::class, [ |
|
57 | 'getRepository' => $repository, |
|
58 | 'getClassMetaData' => (object)['name' => 'aClass'], |
|
59 | 'getConfiguration' => $configuration, |
|
60 | 'persist' => null, |
|
61 | 'flush' => null |
|
62 | ]); |
|
63 | ||
64 | return $emMock; |
|
65 | } |
|
66 | ||
67 | public function testAdaptQueryBuilder() |
|
68 | { |
@@ 44-66 (lines=23) @@ | ||
41 | * |
|
42 | * @return \Doctrine\ORM\EntityManager |
|
43 | */ |
|
44 | protected function getMockedEntityManager() |
|
45 | { |
|
46 | $configuration = Stub::make(Configuration::class, [ |
|
47 | 'getQuoteStrategy' => null |
|
48 | ]); |
|
49 | ||
50 | $repository = Stub::make(EntityRepository::class, [ |
|
51 | 'find' => null, |
|
52 | 'findBy' => null, |
|
53 | 'findOneBy' => null, |
|
54 | ]); |
|
55 | ||
56 | /** @var \Doctrine\ORM\EntityManager $emMock */ |
|
57 | $emMock = Stub::make(EntityManager::class, [ |
|
58 | 'getRepository' => $repository, |
|
59 | 'getConfiguration' => $configuration, |
|
60 | 'getClassMetaData' => (object)['name' => 'aClass'], |
|
61 | 'persist' => null, |
|
62 | 'flush' => null |
|
63 | ]); |
|
64 | ||
65 | return $emMock; |
|
66 | } |
|
67 | ||
68 | public function testAdaptQueryBuilder() |
|
69 | { |