Skip to content

Commit

Permalink
test: fix test for intexer-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Mar 22, 2024
1 parent e0769e3 commit 784cb4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 36 deletions.
12 changes: 3 additions & 9 deletions test/Service/Indexer/InternalResourceIndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ public function setUp(): void
$this->indexerFilter = $this->createMock(
IndexerFilter::class
);
$this->indexerFilter->method('accept')
->willReturn(true);

$this->indexerProgressHandler = $this->createMock(
IndexerProgressHandler::class
Expand Down Expand Up @@ -166,8 +164,7 @@ public function testIndexAllWithChunks(): void

$this->updateResult->method('getStatus')
->willReturn(0);

$this->documentEnricher->method('isIndexable')
$this->indexerFilter->method('accept')
->willReturn(true);

$this->documentEnricher
Expand Down Expand Up @@ -207,7 +204,7 @@ public function testIndexSkipResource(): void
$this->updateResult->method('getStatus')
->willReturn(0);

$this->documentEnricher->method('isIndexable')
$this->indexerFilter->method('accept')
->willReturnCallback(function (Resource $resource) {
$location = $resource->getLocation();
return ($location !== '/a/b.php');
Expand Down Expand Up @@ -263,9 +260,6 @@ public function testWithUnsuccessfulStatus(): void
$this->updateResult->method('getStatus')
->willReturn(500);

$this->documentEnricher->method('isIndexable')
->willReturn(true);

$this->indexerProgressHandler->expects($this->once())
->method('error');

Expand Down Expand Up @@ -323,7 +317,7 @@ public function testIndexPaths(): void
$this->updateResult->method('getStatus')
->willReturn(0);

$this->documentEnricher->method('isIndexable')
$this->indexerFilter->method('accept')
->willReturn(true);

$this->updater->expects($this->exactly(2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,6 @@ public function setUp(): void
);
}

public function testIndexable(): void
{
$resource = $this->createResource([
'init' => [
]
]);

$this->assertTrue(
$this->enricher->isIndexable($resource),
'should be indexalbe'
);
}

public function testNotIndexable(): void
{
$resource = $this->createResource([
'init' => [
'noIndex' => true
]
]);

$this->assertFalse(
$this->enricher->isIndexable($resource),
'should be indexalbe'
);
}

public function testEnrichSpId(): void
{
$resource = $this->createStub(Resource::class);
Expand Down

0 comments on commit 784cb4e

Please sign in to comment.