Skip to content

Commit

Permalink
Debug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Nov 14, 2024
1 parent 6b21ded commit 49cd5b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion interfaces/CustomPagesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getTargets(string $type, ?ContentContainerActiveRecord $containe
* @param ContentContainerActiveRecord|null $container
* @return Target
*/
public function getTargetById($targetId, $type, ContentContainerActiveRecord $container = null): ?Target
public function getTargetById($targetId, $type, ?ContentContainerActiveRecord $container = null): ?Target
{
$availableTargets = $this->getTargets($type, $container);
return array_key_exists($targetId, $availableTargets) ? $availableTargets[$targetId] : null;
Expand Down
3 changes: 3 additions & 0 deletions tests/codeception/unit/InterfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ public function testContentTypeValidation()
public function testAllowedContentType()
{
$target = $this->service->getTargetById('global', PageType::Page);

$this->assertEquals(['debug'], $this->service->getTargets(PageType::Page));

$this->assertFalse($target->isAllowedContentType(TemplateType::ID));
$this->assertTrue($target->isAllowedContentType(MarkdownType::ID));
}
Expand Down

0 comments on commit 49cd5b7

Please sign in to comment.