| @@ 5973-5991 (lines=19) @@ | ||
| 5970 | * |
|
| 5971 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5972 | */ |
|
| 5973 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5974 | { |
|
| 5975 | $repository = $this->getRepository(); |
|
| 5976 | $objectStateService = $repository->getObjectStateService(); |
|
| 5977 | ||
| 5978 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5979 | ||
| 5980 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5981 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 5982 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 5983 | // Only check the first object state which is the default one. |
|
| 5984 | $this->assertEquals( |
|
| 5985 | $objectState, |
|
| 5986 | $contentState |
|
| 5987 | ); |
|
| 5988 | break; |
|
| 5989 | } |
|
| 5990 | } |
|
| 5991 | } |
|
| 5992 | ||
| 5993 | /** |
|
| 5994 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|
| @@ 2079-2097 (lines=19) @@ | ||
| 2076 | * |
|
| 2077 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 2078 | */ |
|
| 2079 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 2080 | { |
|
| 2081 | $repository = $this->getRepository(); |
|
| 2082 | $objectStateService = $repository->getObjectStateService(); |
|
| 2083 | ||
| 2084 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 2085 | ||
| 2086 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 2087 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 2088 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 2089 | // Only check the first object state which is the default one. |
|
| 2090 | $this->assertEquals( |
|
| 2091 | $objectState, |
|
| 2092 | $contentState |
|
| 2093 | ); |
|
| 2094 | break; |
|
| 2095 | } |
|
| 2096 | } |
|
| 2097 | } |
|
| 2098 | ||
| 2099 | /** |
|
| 2100 | * Test for the copySubtree() method. |
|