| @@ 1851-1869 (lines=19) @@ | ||
| 1848 | * |
|
| 1849 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 1850 | */ |
|
| 1851 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 1852 | { |
|
| 1853 | $repository = $this->getRepository(); |
|
| 1854 | $objectStateService = $repository->getObjectStateService(); |
|
| 1855 | ||
| 1856 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 1857 | ||
| 1858 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 1859 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 1860 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 1861 | // Only check the first object state which is the default one. |
|
| 1862 | $this->assertEquals( |
|
| 1863 | $objectState, |
|
| 1864 | $contentState |
|
| 1865 | ); |
|
| 1866 | break; |
|
| 1867 | } |
|
| 1868 | } |
|
| 1869 | } |
|
| 1870 | ||
| 1871 | /** |
|
| 1872 | * Test for the copySubtree() method. |
|
| @@ 5919-5937 (lines=19) @@ | ||
| 5916 | * |
|
| 5917 | * @param \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo |
|
| 5918 | */ |
|
| 5919 | private function assertDefaultContentStates(ContentInfo $contentInfo) |
|
| 5920 | { |
|
| 5921 | $repository = $this->getRepository(); |
|
| 5922 | $objectStateService = $repository->getObjectStateService(); |
|
| 5923 | ||
| 5924 | $objectStateGroups = $objectStateService->loadObjectStateGroups(); |
|
| 5925 | ||
| 5926 | foreach ($objectStateGroups as $objectStateGroup) { |
|
| 5927 | $contentState = $objectStateService->getContentState($contentInfo, $objectStateGroup); |
|
| 5928 | foreach ($objectStateService->loadObjectStates($objectStateGroup) as $objectState) { |
|
| 5929 | // Only check the first object state which is the default one. |
|
| 5930 | $this->assertEquals( |
|
| 5931 | $objectState, |
|
| 5932 | $contentState |
|
| 5933 | ); |
|
| 5934 | break; |
|
| 5935 | } |
|
| 5936 | } |
|
| 5937 | } |
|
| 5938 | ||
| 5939 | /** |
|
| 5940 | * Assert that given Content has no references to a translation specified by the $languageCode. |
|