| @@ 1396-1411 (lines=16) @@ | ||
| 1393 | /** |
|
| 1394 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::setStatus |
|
| 1395 | */ |
|
| 1396 | public function testSetStatus() |
|
| 1397 | { |
|
| 1398 | $handler = $this->getContentHandler(); |
|
| 1399 | ||
| 1400 | $mapperMock = $this->getMapperMock(); |
|
| 1401 | $gatewayMock = $this->getGatewayMock(); |
|
| 1402 | ||
| 1403 | $gatewayMock->expects($this->once()) |
|
| 1404 | ->method('setStatus') |
|
| 1405 | ->with(23, 5, 2) |
|
| 1406 | ->will($this->returnValue(true)); |
|
| 1407 | ||
| 1408 | $this->assertTrue( |
|
| 1409 | $handler->setStatus(23, 2, 5) |
|
| 1410 | ); |
|
| 1411 | } |
|
| 1412 | ||
| 1413 | /** |
|
| 1414 | * Returns the handler to test. |
|
| @@ 852-868 (lines=17) @@ | ||
| 849 | * @expectedException \eZ\Publish\Core\Persistence\Legacy\Exception\RemoveLastGroupFromType |
|
| 850 | * @expectedExceptionMessage Type with ID "23" in status "1" cannot be unlinked from its last group. |
|
| 851 | */ |
|
| 852 | public function testUnlinkFailure() |
|
| 853 | { |
|
| 854 | $gatewayMock = $this->getGatewayMock(); |
|
| 855 | $gatewayMock->expects($this->once()) |
|
| 856 | ->method('countGroupsForType') |
|
| 857 | ->with( |
|
| 858 | $this->equalTo(23), |
|
| 859 | $this->equalTo(1) |
|
| 860 | ) |
|
| 861 | // Only 1 group assigned |
|
| 862 | ->will($this->returnValue(1)); |
|
| 863 | ||
| 864 | $mapperMock = $this->getMapperMock(); |
|
| 865 | ||
| 866 | $handler = $this->getHandler(); |
|
| 867 | $res = $handler->unlink(3, 23, 1); |
|
| 868 | } |
|
| 869 | ||
| 870 | /** |
|
| 871 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::getFieldDefinition |
|