| @@ 1627-1645 (lines=19) @@ | ||
| 1624 | * |
|
| 1625 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1626 | */ |
|
| 1627 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1628 | { |
|
| 1629 | $repository = $this->getRepository(); |
|
| 1630 | $objectStateService = $repository->getObjectStateService(); |
|
| 1631 | ||
| 1632 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1633 | ||
| 1634 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1635 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1636 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1637 | // Only check the first object state which is the default one. |
|
| 1638 | $this->assertEquals( |
|
| 1639 | $objectState, |
|
| 1640 | $contentState |
|
| 1641 | ); |
|
| 1642 | break; |
|
| 1643 | } |
|
| 1644 | } |
|
| 1645 | } |
|
| 1646 | ||
| 1647 | /** |
|
| 1648 | * Test for the copySubtree() method. |
|
| @@ 5991-6009 (lines=19) @@ | ||
| 5988 | * |
|
| 5989 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5990 | */ |
|
| 5991 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5992 | { |
|
| 5993 | $repository = $this->getRepository(); |
|
| 5994 | $objectStateService = $repository->getObjectStateService(); |
|
| 5995 | ||
| 5996 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5997 | ||
| 5998 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5999 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 6000 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 6001 | // Only check the first object state which is the default one. |
|
| 6002 | $this->assertEquals( |
|
| 6003 | $objectState, |
|
| 6004 | $contentState |
|
| 6005 | ); |
|
| 6006 | break; |
|
| 6007 | } |
|
| 6008 | } |
|
| 6009 | } |
|
| 6010 | ||
| 6011 | /** |
|
| 6012 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|