| @@ 1568-1586 (lines=19) @@ | ||
| 1565 | * |
|
| 1566 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1567 | */ |
|
| 1568 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1569 | { |
|
| 1570 | $repository = $this->getRepository(); |
|
| 1571 | $objectStateService = $repository->getObjectStateService(); |
|
| 1572 | ||
| 1573 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1574 | ||
| 1575 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1576 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1577 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1578 | // Only check the first object state which is the default one. |
|
| 1579 | $this->assertEquals( |
|
| 1580 | $objectState, |
|
| 1581 | $contentState |
|
| 1582 | ); |
|
| 1583 | break; |
|
| 1584 | } |
|
| 1585 | } |
|
| 1586 | } |
|
| 1587 | ||
| 1588 | /** |
|
| 1589 | * Test for the copySubtree() method. |
|
| @@ 5781-5799 (lines=19) @@ | ||
| 5778 | * |
|
| 5779 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5780 | */ |
|
| 5781 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5782 | { |
|
| 5783 | $repository = $this->getRepository(); |
|
| 5784 | $objectStateService = $repository->getObjectStateService(); |
|
| 5785 | ||
| 5786 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5787 | ||
| 5788 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5789 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 5790 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 5791 | // Only check the first object state which is the default one. |
|
| 5792 | $this->assertEquals( |
|
| 5793 | $objectState, |
|
| 5794 | $contentState |
|
| 5795 | ); |
|
| 5796 | break; |
|
| 5797 | } |
|
| 5798 | } |
|
| 5799 | } |
|
| 5800 | ||
| 5801 | /** |
|
| 5802 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|