use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Core\System\SalesChannel\SalesChannelEntity;
use Shopware\Core\Test\TestDefaults;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Component\DependencyInjection\Container;
trait StorefrontSalesChannelTestHelper
{ public function getBrowserWithLoggedInCustomer(): KernelBrowser
{ $browser = KernelLifecycleManager::
createBrowser(KernelLifecycleManager::
getKernel(), false
);
$browser->
setServerParameters([ 'HTTP_ACCEPT' => 'application/json',
]);
/** @var Container $container */
$container =
$this->
getContainer();
/** @var EntityRepository $salesChannelRepository */
$salesChannelRepository =
$container->
get('sales_channel.repository'
);
/** @var SalesChannelEntity $salesChannel */
$salesChannel =
$salesChannelRepository->
search( (new Criteria())->
addFilter(new EqualsFilter('typeId', Defaults::SALES_CHANNEL_TYPE_STOREFRONT
)),