| @@ 1544-1562 (lines=19) @@ | ||
| 1541 | * |
|
| 1542 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1543 | */ |
|
| 1544 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1545 | { |
|
| 1546 | $repository = $this->getRepository(); |
|
| 1547 | $objectStateService = $repository->getObjectStateService(); |
|
| 1548 | ||
| 1549 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1550 | ||
| 1551 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1552 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1553 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1554 | // Only check the first object state which is the default one. |
|
| 1555 | $this->assertEquals( |
|
| 1556 | $objectState, |
|
| 1557 | $contentState |
|
| 1558 | ); |
|
| 1559 | break; |
|
| 1560 | } |
|
| 1561 | } |
|
| 1562 | } |
|
| 1563 | ||
| 1564 | /** |
|
| 1565 | * Test for the copySubtree() method. |
|
| @@ 4970-4988 (lines=19) @@ | ||
| 4967 | * |
|
| 4968 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 4969 | */ |
|
| 4970 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 4971 | { |
|
| 4972 | $repository = $this->getRepository(); |
|
| 4973 | $objectStateService = $repository->getObjectStateService(); |
|
| 4974 | ||
| 4975 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 4976 | ||
| 4977 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 4978 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 4979 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 4980 | // Only check the first object state which is the default one. |
|
| 4981 | $this->assertEquals( |
|
| 4982 | $objectState, |
|
| 4983 | $contentState |
|
| 4984 | ); |
|
| 4985 | break; |
|
| 4986 | } |
|
| 4987 | } |
|
| 4988 | } |
|
| 4989 | ||
| 4990 | /** |
|
| 4991 | * Returns the default fixture of fields used in most tests. |
|