Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testConvert() |
||
13 | { |
||
14 | $repository = $this->getMock( |
||
15 | 'Doctrine\\Common\\Persistence\\ObjectRepository', |
||
16 | array('find', 'findAll', 'findBy', 'findOneBy', 'getClassName', 'findOneByName') |
||
17 | ); |
||
18 | |||
19 | $converter = new StringToObjectConverter($repository, 'name'); |
||
20 | |||
21 | $class = new \stdClass(); |
||
22 | |||
23 | $repository->expects($this->once()) |
||
24 | ->method('findOneByName') |
||
25 | ->with('bar') |
||
26 | ->will($this->returnValue($class)); |
||
27 | |||
28 | $this->assertEquals($class, call_user_func($converter, 'bar')); |
||
29 | } |
||
30 | } |
||
31 |