| @@ 1664-1682 (lines=19) @@ | ||
| 1661 | * |
|
| 1662 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1663 | */ |
|
| 1664 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1665 | { |
|
| 1666 | $repository = $this->getRepository(); |
|
| 1667 | $objectStateService = $repository->getObjectStateService(); |
|
| 1668 | ||
| 1669 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1670 | ||
| 1671 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1672 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1673 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1674 | // Only check the first object state which is the default one. |
|
| 1675 | $this->assertEquals( |
|
| 1676 | $objectState, |
|
| 1677 | $contentState |
|
| 1678 | ); |
|
| 1679 | break; |
|
| 1680 | } |
|
| 1681 | } |
|
| 1682 | } |
|
| 1683 | ||
| 1684 | /** |
|
| 1685 | * Test for the copySubtree() method. |
|
| @@ 5829-5847 (lines=19) @@ | ||
| 5826 | * |
|
| 5827 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5828 | */ |
|
| 5829 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5830 | { |
|
| 5831 | $repository = $this->getRepository(); |
|
| 5832 | $objectStateService = $repository->getObjectStateService(); |
|
| 5833 | ||
| 5834 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5835 | ||
| 5836 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5837 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 5838 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 5839 | // Only check the first object state which is the default one. |
|
| 5840 | $this->assertEquals( |
|
| 5841 | $objectState, |
|
| 5842 | $contentState |
|
| 5843 | ); |
|
| 5844 | break; |
|
| 5845 | } |
|
| 5846 | } |
|
| 5847 | } |
|
| 5848 | ||
| 5849 | /** |
|
| 5850 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|