| @@ 25-51 (lines=27) @@ | ||
| 22 | */ |
|
| 23 | protected $objectRepository; |
|
| 24 | ||
| 25 | protected function setUp() |
|
| 26 | { |
|
| 27 | $objectManager = $this->getMockBuilder(ObjectManager::class) |
|
| 28 | ->disableOriginalConstructor() |
|
| 29 | ->getMock(); |
|
| 30 | ||
| 31 | /** @var ManagerRegistry|\PHPUnit_Framework_MockObject_MockObject $managerRegistry */ |
|
| 32 | $managerRegistry = $this->getMockBuilder(ManagerRegistry::class) |
|
| 33 | ->disableOriginalConstructor() |
|
| 34 | ->getMock(); |
|
| 35 | ||
| 36 | $managerRegistry |
|
| 37 | ->expects($this->any()) |
|
| 38 | ->method('getManagerForClass') |
|
| 39 | ->willReturn($objectManager); |
|
| 40 | ||
| 41 | $this->objectRepository = $this->getMockBuilder(ObjectRepository::class) |
|
| 42 | ->disableOriginalConstructor() |
|
| 43 | ->getMock(); |
|
| 44 | ||
| 45 | $objectManager |
|
| 46 | ->expects($this->any()) |
|
| 47 | ->method('getRepository') |
|
| 48 | ->willReturn($this->objectRepository); |
|
| 49 | ||
| 50 | $this->manager = new CallbackManager($managerRegistry, 'Loevgaard\DandomainAltapayBundle\Tests\TestCallback'); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function testCreateCallbackFromRequest() |
|
| 54 | { |
|
| @@ 24-50 (lines=27) @@ | ||
| 21 | */ |
|
| 22 | protected $objectRepository; |
|
| 23 | ||
| 24 | protected function setUp() |
|
| 25 | { |
|
| 26 | $objectManager = $this->getMockBuilder(ObjectManager::class) |
|
| 27 | ->disableOriginalConstructor() |
|
| 28 | ->getMock(); |
|
| 29 | ||
| 30 | /** @var ManagerRegistry|\PHPUnit_Framework_MockObject_MockObject $managerRegistry */ |
|
| 31 | $managerRegistry = $this->getMockBuilder(ManagerRegistry::class) |
|
| 32 | ->disableOriginalConstructor() |
|
| 33 | ->getMock(); |
|
| 34 | ||
| 35 | $managerRegistry |
|
| 36 | ->expects($this->any()) |
|
| 37 | ->method('getManagerForClass') |
|
| 38 | ->willReturn($objectManager); |
|
| 39 | ||
| 40 | $this->objectRepository = $this->getMockBuilder(ObjectRepository::class) |
|
| 41 | ->disableOriginalConstructor() |
|
| 42 | ->getMock(); |
|
| 43 | ||
| 44 | $objectManager |
|
| 45 | ->expects($this->any()) |
|
| 46 | ->method('getRepository') |
|
| 47 | ->willReturn($this->objectRepository); |
|
| 48 | ||
| 49 | $this->manager = new TerminalManager($managerRegistry, 'Loevgaard\DandomainAltapayBundle\Entity\Terminal'); |
|
| 50 | } |
|
| 51 | ||
| 52 | public function testFindTerminalByTitle() |
|
| 53 | { |
|