public function testCreateContentWithoutLocationsThrowsUnauthorizedException() { $testContentType = $this->createTestContentType(); $contentService = $this->repository->getContentService(); $contentCreate = $contentService->newContentCreateStruct($testContentType, 'eng-GB'); $contentCreate->setField('test_required_empty', 'value for field definition with empty default value'); $contentCreate->setField('test_translatable', 'and thumbs opposable', 'eng-US'); $contentCreate->sectionId = 1; $contentCreate->ownerId = $this->repository->getCurrentUserReference()->getUserId(); $contentCreate->remoteId = 'abcdef0123456789abcdef0123456789'; $contentCreate->alwaysAvailable = true; // Set anonymous as current user $this->repository->setCurrentUser($this->getStubbedUser(10)); $contentService->createContent($contentCreate, array()); }