Skip to content

Commit

Permalink
NGSTACK-836 update tests throws tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Katarina Miočić committed Jul 11, 2024
1 parent 4fa5771 commit 64247b5
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 29 deletions.
50 changes: 45 additions & 5 deletions tests/lib/Integration/API/DescendantIndexingContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
use Ibexa\Core\Repository\SiteAccessAware\ContentTypeService;
use Ibexa\Tests\Integration\Core\Repository\BaseTest;

/**
* @group descendant-indexing
*/
final class DescendantIndexingContentTest extends BaseTest
{
/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
Expand Down Expand Up @@ -52,6 +50,7 @@ public function testPublishVersion()
}

/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
Expand All @@ -61,7 +60,6 @@ public function testPublishVersion()
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*
* @group delete
* @depends testPublishVersion
*/
public function testDeleteContent(): void
Expand Down Expand Up @@ -91,6 +89,7 @@ public function testDeleteContent(): void
}

/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
Expand Down Expand Up @@ -129,6 +128,17 @@ public function testDeleteTranslation(): void
}


/**
* @return int
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function testHideContent(): int
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -158,6 +168,7 @@ public function testHideContent(): int
}

/**
* @param int $hiddenContentId
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
Expand Down Expand Up @@ -195,6 +206,16 @@ public function testRevealContent(int $hiddenContentId): void

}

/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function testUpdateContentMetadataHandler(): void
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -228,7 +249,16 @@ public function testUpdateContentMetadataHandler(): void

}


/**
* @param ContentTypeService $contentTypeService
* @param string $identifier
* @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
private function createContentType(ContentTypeService $contentTypeService, string $identifier) {

$contentTypeGroups = $contentTypeService->loadContentTypeGroups();
Expand All @@ -246,6 +276,16 @@ private function createContentType(ContentTypeService $contentTypeService, strin

}

/**
* @return array
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
private function createContentForTesting() {
$repository = $this->getRepository();
$contentService = $repository->getContentService();
Expand Down
99 changes: 83 additions & 16 deletions tests/lib/Integration/API/DescendantIndexingLocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
use Ibexa\Core\Repository\SiteAccessAware\ContentTypeService;
use Ibexa\Tests\Integration\Core\Repository\BaseTest;

/**
* @group descendant-indexing
*/
final class DescendantIndexingLocationTest extends BaseTest
{

/**
* @return void
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @group assign-section-to-subtree
*/
public function testAssignSectionToSubtree()
{
Expand Down Expand Up @@ -74,7 +75,16 @@ public function testAssignSectionToSubtree()

}


/**
* @return void
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function testCopySubtree()
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -116,6 +126,16 @@ public function testCopySubtree()

}

/**
* @return void
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function testCreateLocation()
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -143,6 +163,16 @@ public function testCreateLocation()
self::assertEquals($parentContentFound->id, $parentLocation->contentId);
}

/**
* @return void
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function testDeleteLocation()
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -170,7 +200,16 @@ public function testDeleteLocation()
self::assertEquals(0, $searchResult->totalCount);
}


/**
* @return void
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function testMoveSubtree()
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -226,11 +265,13 @@ public function testMoveSubtree()

/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
* @group swap
*/
public function testSwapLocation()
{
Expand Down Expand Up @@ -277,6 +318,16 @@ public function testSwapLocation()
self::assertEquals(0, $searchResult->totalCount);
}

/**
* @return array
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function testHideLocation()
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -310,11 +361,12 @@ public function testHideLocation()
}

/**
* @param array $locations
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*
* @depends testHideLocation
*/
Expand Down Expand Up @@ -353,11 +405,13 @@ public function testUnhideLocation(array $locations)

/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
* @group update-location
*/
public function testUpdateLocation()
{
Expand Down Expand Up @@ -398,6 +452,16 @@ public function testUpdateLocation()
self::assertEquals($parentLocation->contentId, $parentContentFound->contentInfo->id);
}

/**
* @param ContentTypeService $contentTypeService
* @param string $identifier
* @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType
* @throws BadStateException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
private function createContentType(ContentTypeService $contentTypeService, string $identifier) {
$contentTypeGroups = $contentTypeService->loadContentTypeGroups();
$contentTypeCreateStruct = $contentTypeService->newContentTypeCreateStruct($identifier);
Expand All @@ -416,11 +480,14 @@ private function createContentType(ContentTypeService $contentTypeService, strin
}

/**
* @throws ContentFieldValidationException
* @throws InvalidArgumentException
* @return array
* @throws BadStateException
* @throws ContentFieldValidationException
* @throws ContentValidationException
* @throws InvalidArgumentException
* @throws UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
private function createLocationsForTesting() {
$repository = $this->getRepository();
Expand Down
28 changes: 25 additions & 3 deletions tests/lib/Integration/API/DescendantIndexingObjectStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
use Ibexa\Core\Repository\SiteAccessAware\ContentTypeService;
use Ibexa\Tests\Integration\Core\Repository\BaseTest;

/**
* @group descendant-indexing
*/
final class DescendantIndexingObjectStateTest extends BaseTest
{

/**
* @return void
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function testSetObjectState()
{
$repository = $this->getRepository();
Expand Down Expand Up @@ -58,6 +62,14 @@ public function testSetObjectState()
}


/**
* @return array
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentFieldValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
private function createContentForTesting() {
$repository = $this->getRepository();
$contentService = $repository->getContentService();
Expand Down Expand Up @@ -95,6 +107,16 @@ private function createContentForTesting() {
];
}

/**
* @param ContentTypeService $contentTypeService
* @param string $identifier
* @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentTypeFieldDefinitionValidationException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
private function createContentType(ContentTypeService $contentTypeService, string $identifier) {
$contentTypeGroups = $contentTypeService->loadContentTypeGroups();
$contentTypeCreateStruct = $contentTypeService->newContentTypeCreateStruct($identifier);
Expand Down
Loading

0 comments on commit 64247b5

Please sign in to comment.