| @@ 231-265 (lines=35) @@ | ||
| 228 |         $this->pathFinder->getPathToEntity("AppBundle\\Entity\\Family"); | 
                                |
| 229 | }  | 
                                |
| 230 | ||
| 231 | public function testCountNumberOfParentOfRelationEntity()  | 
                                |
| 232 |     { | 
                                |
| 233 | $this->samepleJson = [  | 
                                |
| 234 | "FooBundle\\Entity\\Zzz" => [  | 
                                |
| 235 | "relations" => [  | 
                                |
| 236 | "items" => "AppBundle\\Entity\\Foo",  | 
                                |
| 237 | ]  | 
                                |
| 238 | ],  | 
                                |
| 239 | "FooBundle\\Entity\\Item" => [  | 
                                |
| 240 | "relations" => [  | 
                                |
| 241 | "items" => "AppBundle\\Entity\\Foo",  | 
                                |
| 242 | ]  | 
                                |
| 243 | ],  | 
                                |
| 244 | ];  | 
                                |
| 245 | ||
| 246 | $this->mapper = $this  | 
                                |
| 247 |             ->getMockBuilder('Mado\QueryBundle\Component\Meta\DataMapper') | 
                                |
| 248 | ->disableOriginalConstructor()  | 
                                |
| 249 | ->getMock();  | 
                                |
| 250 | ||
| 251 | $this->mapper->expects($this->once())  | 
                                |
| 252 |             ->method('getMap') | 
                                |
| 253 | ->will($this->returnValue(  | 
                                |
| 254 | $this->samepleJson  | 
                                |
| 255 | ));  | 
                                |
| 256 | ||
| 257 | $this->pathFinder = new JsonPathFinder(  | 
                                |
| 258 | $this->mapper  | 
                                |
| 259 | );  | 
                                |
| 260 | ||
| 261 | $this->assertEquals(  | 
                                |
| 262 | 2,  | 
                                |
| 263 |             $this->pathFinder->numberOfRelationsToEntity("AppBundle\\Entity\\Foo") | 
                                |
| 264 | );  | 
                                |
| 265 | }  | 
                                |
| 266 | ||
| 267 | public function testListParentOfInnerEntity()  | 
                                |
| 268 |     { | 
                                |
| @@ 267-304 (lines=38) @@ | ||
| 264 | );  | 
                                |
| 265 | }  | 
                                |
| 266 | ||
| 267 | public function testListParentOfInnerEntity()  | 
                                |
| 268 |     { | 
                                |
| 269 | $this->samepleJson = [  | 
                                |
| 270 | "FooBundle\\Entity\\Zzz" => [  | 
                                |
| 271 | "relations" => [  | 
                                |
| 272 | "items" => "AppBundle\\Entity\\Foo",  | 
                                |
| 273 | ]  | 
                                |
| 274 | ],  | 
                                |
| 275 | "FooBundle\\Entity\\Item" => [  | 
                                |
| 276 | "relations" => [  | 
                                |
| 277 | "items" => "AppBundle\\Entity\\Foo",  | 
                                |
| 278 | ]  | 
                                |
| 279 | ],  | 
                                |
| 280 | ];  | 
                                |
| 281 | ||
| 282 | $this->mapper = $this  | 
                                |
| 283 |             ->getMockBuilder('Mado\QueryBundle\Component\Meta\DataMapper') | 
                                |
| 284 | ->disableOriginalConstructor()  | 
                                |
| 285 | ->getMock();  | 
                                |
| 286 | ||
| 287 | $this->mapper->expects($this->once())  | 
                                |
| 288 |             ->method('getMap') | 
                                |
| 289 | ->will($this->returnValue(  | 
                                |
| 290 | $this->samepleJson  | 
                                |
| 291 | ));  | 
                                |
| 292 | ||
| 293 | $this->pathFinder = new JsonPathFinder(  | 
                                |
| 294 | $this->mapper  | 
                                |
| 295 | );  | 
                                |
| 296 | ||
| 297 | $this->assertEquals(  | 
                                |
| 298 | [  | 
                                |
| 299 | "FooBundle\\Entity\\Zzz",  | 
                                |
| 300 | "FooBundle\\Entity\\Item",  | 
                                |
| 301 | ],  | 
                                |
| 302 |             $this->pathFinder->listOfParentsOf("AppBundle\\Entity\\Foo") | 
                                |
| 303 | );  | 
                                |
| 304 | }  | 
                                |
| 305 | ||
| 306 | public function testBuildListOfEntityReachedDuringTheWalk()  | 
                                |
| 307 |     { | 
                                |