| @@ 2162-2180 (lines=19) @@ | ||
| 2159 | * |
|
| 2160 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 2161 | */ |
|
| 2162 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 2163 | { |
|
| 2164 | $repository = $this->getRepository(); |
|
| 2165 | $objectStateService = $repository->getObjectStateService(); |
|
| 2166 | ||
| 2167 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 2168 | ||
| 2169 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 2170 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 2171 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 2172 | // Only check the first object state which is the default one. |
|
| 2173 | $this->assertEquals( |
|
| 2174 | $objectState, |
|
| 2175 | $contentState |
|
| 2176 | ); |
|
| 2177 | break; |
|
| 2178 | } |
|
| 2179 | } |
|
| 2180 | } |
|
| 2181 | ||
| 2182 | /** |
|
| 2183 | * Test for the copySubtree() method. |
|
| @@ 6148-6166 (lines=19) @@ | ||
| 6145 | * |
|
| 6146 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 6147 | */ |
|
| 6148 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 6149 | { |
|
| 6150 | $repository = $this->getRepository(); |
|
| 6151 | $objectStateService = $repository->getObjectStateService(); |
|
| 6152 | ||
| 6153 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 6154 | ||
| 6155 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 6156 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 6157 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 6158 | // Only check the first object state which is the default one. |
|
| 6159 | $this->assertEquals( |
|
| 6160 | $objectState, |
|
| 6161 | $contentState |
|
| 6162 | ); |
|
| 6163 | break; |
|
| 6164 | } |
|
| 6165 | } |
|
| 6166 | } |
|
| 6167 | ||
| 6168 | /** |
|
| 6169 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|