| @@ 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. |
|
| @@ 5562-5580 (lines=19) @@ | ||
| 5559 | * |
|
| 5560 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5561 | */ |
|
| 5562 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5563 | { |
|
| 5564 | $repository = $this->getRepository(); |
|
| 5565 | $objectStateService = $repository->getObjectStateService(); |
|
| 5566 | ||
| 5567 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5568 | ||
| 5569 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5570 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 5571 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 5572 | // Only check the first object state which is the default one. |
|
| 5573 | $this->assertEquals( |
|
| 5574 | $objectState, |
|
| 5575 | $contentState |
|
| 5576 | ); |
|
| 5577 | break; |
|
| 5578 | } |
|
| 5579 | } |
|
| 5580 | } |
|
| 5581 | ||
| 5582 | /** |
|
| 5583 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|