|
@@ 949-969 (lines=21) @@
|
| 946 |
|
* @see \eZ\Publish\API\Repository\ObjectStateService::loadObjectState() |
| 947 |
|
* @depends testLoadObjectStateGroup |
| 948 |
|
*/ |
| 949 |
|
public function testLoadObjectState() |
| 950 |
|
{ |
| 951 |
|
$repository = $this->getRepository(); |
| 952 |
|
|
| 953 |
|
$objectStateId = $this->generateId('objectstate', 2); |
| 954 |
|
/* BEGIN: Use Case */ |
| 955 |
|
// $objectStateId contains the ID of the "locked" state |
| 956 |
|
$objectStateService = $repository->getObjectStateService(); |
| 957 |
|
|
| 958 |
|
$loadedObjectState = $objectStateService->loadObjectState( |
| 959 |
|
$objectStateId |
| 960 |
|
); |
| 961 |
|
/* END: Use Case */ |
| 962 |
|
|
| 963 |
|
$this->assertInstanceOf( |
| 964 |
|
'eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectState', |
| 965 |
|
$loadedObjectState |
| 966 |
|
); |
| 967 |
|
|
| 968 |
|
return $loadedObjectState; |
| 969 |
|
} |
| 970 |
|
|
| 971 |
|
/** |
| 972 |
|
* testLoadObjectStateStructValues. |
|
@@ 1616-1631 (lines=16) @@
|
| 1613 |
|
* @see \eZ\Publish\API\Repository\ObjectStateService::getContentCount() |
| 1614 |
|
* @depends testLoadObjectState |
| 1615 |
|
*/ |
| 1616 |
|
public function testGetContentCount() |
| 1617 |
|
{ |
| 1618 |
|
$repository = $this->getRepository(); |
| 1619 |
|
|
| 1620 |
|
$notLockedObjectStateId = $this->generateId('objectstate', 1); |
| 1621 |
|
/* BEGIN: Use Case */ |
| 1622 |
|
// $notLockedObjectStateId is the ID of the state "not_locked" |
| 1623 |
|
$objectStateService = $repository->getObjectStateService(); |
| 1624 |
|
|
| 1625 |
|
$notLockedObjectState = $objectStateService->loadObjectState($notLockedObjectStateId); |
| 1626 |
|
|
| 1627 |
|
$objectCount = $objectStateService->getContentCount($notLockedObjectState); |
| 1628 |
|
/* END: Use Case */ |
| 1629 |
|
|
| 1630 |
|
$this->assertEquals(18, $objectCount); |
| 1631 |
|
} |
| 1632 |
|
|
| 1633 |
|
/** |
| 1634 |
|
* Test for the deleteObjectState() method. |