| @@ 6031-6049 (lines=19) @@ | ||
| 6028 | * |
|
| 6029 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 6030 | */ |
|
| 6031 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 6032 | { |
|
| 6033 | $repository = $this->getRepository(); |
|
| 6034 | $objectStateService = $repository->getObjectStateService(); |
|
| 6035 | ||
| 6036 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 6037 | ||
| 6038 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 6039 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 6040 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 6041 | // Only check the first object state which is the default one. |
|
| 6042 | $this->assertEquals( |
|
| 6043 | $objectState, |
|
| 6044 | $contentState |
|
| 6045 | ); |
|
| 6046 | break; |
|
| 6047 | } |
|
| 6048 | } |
|
| 6049 | } |
|
| 6050 | ||
| 6051 | /** |
|
| 6052 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|
| @@ 2142-2160 (lines=19) @@ | ||
| 2139 | * |
|
| 2140 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 2141 | */ |
|
| 2142 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 2143 | { |
|
| 2144 | $repository = $this->getRepository(); |
|
| 2145 | $objectStateService = $repository->getObjectStateService(); |
|
| 2146 | ||
| 2147 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 2148 | ||
| 2149 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 2150 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 2151 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 2152 | // Only check the first object state which is the default one. |
|
| 2153 | $this->assertEquals( |
|
| 2154 | $objectState, |
|
| 2155 | $contentState |
|
| 2156 | ); |
|
| 2157 | break; |
|
| 2158 | } |
|
| 2159 | } |
|
| 2160 | } |
|
| 2161 | ||
| 2162 | /** |
|
| 2163 | * Test for the copySubtree() method. |
|