| @@ 1531-1549 (lines=19) @@ | ||
| 1528 | * |
|
| 1529 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1530 | */ |
|
| 1531 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1532 | { |
|
| 1533 | $repository = $this->getRepository(); |
|
| 1534 | $objectStateService = $repository->getObjectStateService(); |
|
| 1535 | ||
| 1536 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1537 | ||
| 1538 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1539 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1540 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1541 | // Only check the first object state which is the default one. |
|
| 1542 | $this->assertEquals( |
|
| 1543 | $objectState, |
|
| 1544 | $contentState |
|
| 1545 | ); |
|
| 1546 | break; |
|
| 1547 | } |
|
| 1548 | } |
|
| 1549 | } |
|
| 1550 | ||
| 1551 | /** |
|
| 1552 | * Test for the copySubtree() method. |
|
| @@ 4851-4869 (lines=19) @@ | ||
| 4848 | * |
|
| 4849 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 4850 | */ |
|
| 4851 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 4852 | { |
|
| 4853 | $repository = $this->getRepository(); |
|
| 4854 | $objectStateService = $repository->getObjectStateService(); |
|
| 4855 | ||
| 4856 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 4857 | ||
| 4858 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 4859 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 4860 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 4861 | // Only check the first object state which is the default one. |
|
| 4862 | $this->assertEquals( |
|
| 4863 | $objectState, |
|
| 4864 | $contentState |
|
| 4865 | ); |
|
| 4866 | break; |
|
| 4867 | } |
|
| 4868 | } |
|
| 4869 | } |
|
| 4870 | ||
| 4871 | /** |
|
| 4872 | * Returns the default fixture of fields used in most tests. |
|