| @@ 525-545 (lines=21) @@ | ||
| 522 | /** |
|
| 523 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoByRemoteId |
|
| 524 | */ |
|
| 525 | public function testLoadContentInfoByRemoteId() |
|
| 526 | { |
|
| 527 | $contentInfoData = array(new ContentInfo()); |
|
| 528 | $this->getGatewayMock()->expects($this->once()) |
|
| 529 | ->method('loadContentInfoByRemoteId') |
|
| 530 | ->with( |
|
| 531 | $this->equalTo('15b256dbea2ae72418ff5facc999e8f9') |
|
| 532 | )->will( |
|
| 533 | $this->returnValue(array(42)) |
|
| 534 | ); |
|
| 535 | ||
| 536 | $this->getMapperMock()->expects($this->once()) |
|
| 537 | ->method('extractContentInfoFromRow') |
|
| 538 | ->with($this->equalTo(array(42))) |
|
| 539 | ->will($this->returnValue($contentInfoData)); |
|
| 540 | ||
| 541 | $this->assertSame( |
|
| 542 | $contentInfoData, |
|
| 543 | $this->getContentHandler()->loadContentInfoByRemoteId('15b256dbea2ae72418ff5facc999e8f9') |
|
| 544 | ); |
|
| 545 | } |
|
| 546 | ||
| 547 | /** |
|
| 548 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::load |
|
| @@ 27-47 (lines=21) @@ | ||
| 24 | */ |
|
| 25 | class TreeHandlerTest extends TestCase |
|
| 26 | { |
|
| 27 | public function testLoadContentInfoByRemoteId() |
|
| 28 | { |
|
| 29 | $contentInfoData = array(new ContentInfo()); |
|
| 30 | ||
| 31 | $this->getContentGatewayMock() |
|
| 32 | ->expects($this->once()) |
|
| 33 | ->method('loadContentInfo') |
|
| 34 | ->with(42) |
|
| 35 | ->will($this->returnValue(array(42))); |
|
| 36 | ||
| 37 | $this->getContentMapperMock() |
|
| 38 | ->expects($this->once()) |
|
| 39 | ->method('extractContentInfoFromRow') |
|
| 40 | ->with($this->equalTo(array(42))) |
|
| 41 | ->will($this->returnValue($contentInfoData)); |
|
| 42 | ||
| 43 | $this->assertSame( |
|
| 44 | $contentInfoData, |
|
| 45 | $this->getTreeHandler()->loadContentInfo(42) |
|
| 46 | ); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function testListVersions() |
|
| 50 | { |
|