Skip to content

Commit

Permalink
OP-463: Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Aug 1, 2024
1 parent b63950f commit ad8fd21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ BitBag\SyliusCmsPlugin\Entity\Template:
template3:
name: 'template3-name'
type: 'page'
template4:
name: 'template4-name'
type: 'block'
template5:
name: 'template5-name'
type: 'block'
template6:
name: 'template6-name'
type: 'block'
14 changes: 14 additions & 0 deletions tests/Integration/Repository/TemplateRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ public function test_it_finds_template_page_by_name_part(): void
self::assertCount(3, $template);
}

public function test_it_finds_template_block_by_name_part(): void
{
$this->loadFixturesFromFile('TemplateRepositoryTest/test_it_finds_template_by_name.yml');

$repository = $this->getRepository();

$phrase = 'template';
$type = 'block';
$template = $repository->findTemplatesByNamePart($phrase, $type);

self::assertIsArray($template);
self::assertCount(3, $template);
}

private function getRepository(): TemplateRepositoryInterface
{
/** @var TemplateRepositoryInterface $repository */
Expand Down

0 comments on commit ad8fd21

Please sign in to comment.