| @@ 1458-1473 (lines=16) @@ | ||
| 1455 | /** |
|
| 1456 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::setStatus |
|
| 1457 | */ |
|
| 1458 | public function testSetStatus() |
|
| 1459 | { |
|
| 1460 | $handler = $this->getContentHandler(); |
|
| 1461 | ||
| 1462 | $mapperMock = $this->getMapperMock(); |
|
| 1463 | $gatewayMock = $this->getGatewayMock(); |
|
| 1464 | ||
| 1465 | $gatewayMock->expects($this->once()) |
|
| 1466 | ->method('setStatus') |
|
| 1467 | ->with(23, 5, 2) |
|
| 1468 | ->will($this->returnValue(true)); |
|
| 1469 | ||
| 1470 | $this->assertTrue( |
|
| 1471 | $handler->setStatus(23, 2, 5) |
|
| 1472 | ); |
|
| 1473 | } |
|
| 1474 | ||
| 1475 | /** |
|
| 1476 | * Returns the handler to test. |
|
| @@ 879-895 (lines=17) @@ | ||
| 876 | * @expectedException \eZ\Publish\Core\Persistence\Legacy\Exception\RemoveLastGroupFromType |
|
| 877 | * @expectedExceptionMessage Type with ID "23" in status "1" cannot be unlinked from its last group. |
|
| 878 | */ |
|
| 879 | public function testUnlinkFailure() |
|
| 880 | { |
|
| 881 | $gatewayMock = $this->getGatewayMock(); |
|
| 882 | $gatewayMock->expects($this->once()) |
|
| 883 | ->method('countGroupsForType') |
|
| 884 | ->with( |
|
| 885 | $this->equalTo(23), |
|
| 886 | $this->equalTo(1) |
|
| 887 | ) |
|
| 888 | // Only 1 group assigned |
|
| 889 | ->will($this->returnValue(1)); |
|
| 890 | ||
| 891 | $mapperMock = $this->getMapperMock(); |
|
| 892 | ||
| 893 | $handler = $this->getHandler(); |
|
| 894 | $res = $handler->unlink(3, 23, 1); |
|
| 895 | } |
|
| 896 | ||
| 897 | /** |
|
| 898 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::getFieldDefinition |
|