Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/bundle/Command/TestSiteaccessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Ibexa\Bundle\Behat\Command;

use Ibexa\Core\MVC\Symfony\SiteAccess;
use Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -17,12 +17,11 @@
#[AsCommand(name: 'ibexa:behat:test-siteaccess', description: 'Outputs the name of the active siteaccess')]
class TestSiteaccessCommand extends Command
{
/** @var SiteAccess */
private $siteaccess;
private SiteAccessServiceInterface $siteAccessService;

public function __construct(SiteAccess $siteaccess)
public function __construct(SiteAccessServiceInterface $siteAccessService)
{
$this->siteaccess = $siteaccess;
$this->siteAccessService = $siteAccessService;

parent::__construct();
}
Expand All @@ -31,7 +30,8 @@ protected function execute(
InputInterface $input,
OutputInterface $output
): int {
$output->writeln($this->siteaccess->name);
$siteAccess = $this->siteAccessService->getCurrent();
$output->writeln($siteAccess !== null ? $siteAccess->name : '');

return self::SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ services:

Ibexa\Bundle\Behat\Command\TestSiteaccessCommand:
arguments:
$siteaccess: '@Ibexa\Core\MVC\Symfony\SiteAccess'
$siteAccessService: '@Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface'
tags:
- { name: console.command }

Expand Down