public function testCreateContentTypeDraftThrowsBadStateException() { $publishedType = $this->createPublishedContentType(); // Create draft for current user $this->repository->getContentTypeService()->createContentTypeDraft($publishedType); /* BEGIN: Use case */ // $publishedType contains a ContentType object $contentTypeService = $this->repository->getContentTypeService(); // Throws an exception because ContentType has an existing draft belonging to another user $draft = $contentTypeService->createContentTypeDraft($publishedType); /* END: Use case */ }