|
@@ 959-979 (lines=21) @@
|
| 956 |
|
* @see \eZ\Publish\API\Repository\ObjectStateService::loadObjectState() |
| 957 |
|
* @depends testLoadObjectStateGroup |
| 958 |
|
*/ |
| 959 |
|
public function testLoadObjectState() |
| 960 |
|
{ |
| 961 |
|
$repository = $this->getRepository(); |
| 962 |
|
|
| 963 |
|
$objectStateId = $this->generateId('objectstate', 2); |
| 964 |
|
/* BEGIN: Use Case */ |
| 965 |
|
// $objectStateId contains the ID of the "locked" state |
| 966 |
|
$objectStateService = $repository->getObjectStateService(); |
| 967 |
|
|
| 968 |
|
$loadedObjectState = $objectStateService->loadObjectState( |
| 969 |
|
$objectStateId |
| 970 |
|
); |
| 971 |
|
/* END: Use Case */ |
| 972 |
|
|
| 973 |
|
$this->assertInstanceOf( |
| 974 |
|
'eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectState', |
| 975 |
|
$loadedObjectState |
| 976 |
|
); |
| 977 |
|
|
| 978 |
|
return $loadedObjectState; |
| 979 |
|
} |
| 980 |
|
|
| 981 |
|
/** |
| 982 |
|
* testLoadObjectStateStructValues. |
|
@@ 1636-1651 (lines=16) @@
|
| 1633 |
|
* @see \eZ\Publish\API\Repository\ObjectStateService::getContentCount() |
| 1634 |
|
* @depends testLoadObjectState |
| 1635 |
|
*/ |
| 1636 |
|
public function testGetContentCount() |
| 1637 |
|
{ |
| 1638 |
|
$repository = $this->getRepository(); |
| 1639 |
|
|
| 1640 |
|
$notLockedObjectStateId = $this->generateId('objectstate', 1); |
| 1641 |
|
/* BEGIN: Use Case */ |
| 1642 |
|
// $notLockedObjectStateId is the ID of the state "not_locked" |
| 1643 |
|
$objectStateService = $repository->getObjectStateService(); |
| 1644 |
|
|
| 1645 |
|
$notLockedObjectState = $objectStateService->loadObjectState($notLockedObjectStateId); |
| 1646 |
|
|
| 1647 |
|
$objectCount = $objectStateService->getContentCount($notLockedObjectState); |
| 1648 |
|
/* END: Use Case */ |
| 1649 |
|
|
| 1650 |
|
$this->assertEquals(18, $objectCount); |
| 1651 |
|
} |
| 1652 |
|
|
| 1653 |
|
/** |
| 1654 |
|
* Test for the deleteObjectState() method. |