Skip to content

Commit

Permalink
[MAINTENANCE] Remove unused function getCollectionForMetadata() (#1389
Browse files Browse the repository at this point in the history
)

Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Dec 16, 2024
1 parent 9b73c2c commit 460cc66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
19 changes: 0 additions & 19 deletions Classes/Domain/Repository/CollectionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ public function findAllByUids(array $uids): QueryResultInterface
return $query->execute();
}

/**
* Finds all collections
*
* @access public
*
* @param string $pages
*
* @return QueryResultInterface
*/
public function getCollectionForMetadata(string $pages): QueryResultInterface
{
// Get list of collections to show.
$query = $this->createQuery();

$query->matching($query->equals('pid', $pages));

return $query->execute();
}

/**
* Finds all collection for the given settings
*
Expand Down
21 changes: 0 additions & 21 deletions Tests/Functional/Repository/CollectionRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,6 @@ public function canFindAllByUids(): void
self::assertArrayHasKey('Collection with single document', $collectionsByLabel);
}

/**
* @test
* @group find
*/
public function canGetCollectionForMetadata(): void
{
$collections = $this->collectionRepository->getCollectionForMetadata("20000");
self::assertNotNull($collections);
self::assertInstanceOf(QueryResult::class, $collections);

$collectionsByLabel = [];
foreach ($collections as $collection) {
$collectionsByLabel[$collection->getLabel()] = $collection;
}

self::assertArrayHasKey('Musik', $collectionsByLabel);
self::assertArrayHasKey('Collection with single document', $collectionsByLabel);
self::assertArrayHasKey('Geschichte', $collectionsByLabel);
self::assertArrayHasKey('Bildende Kunst', $collectionsByLabel);
}

/**
* @param $settings
* @return array
Expand Down

0 comments on commit 460cc66

Please sign in to comment.