Skip to content

Commit

Permalink
Merge branch 'NEXT-39888/fix-deprecated' into 'trunk'
Browse files Browse the repository at this point in the history
NEXT-39888 - removes unused parameter

Closes NEXT-39888

See merge request shopware/6/product/platform!15456
  • Loading branch information
nfortier-shopware committed Dec 3, 2024
2 parents 7517f0b + 03543e8 commit 541adc4
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
use PHPUnit\Framework\TestCase;
use Shopware\Core\Checkout\Cart\Exception\CustomerNotLoggedInException;
use Shopware\Core\Checkout\Customer\Event\CustomerLoginEvent;
Expand Down Expand Up @@ -258,44 +257,6 @@ public static function dataProviderXMLHttpRequest(): \Generator
];
}

#[DoesNotPerformAssertions]
#[DataProvider('dataProviderStartSession')]
public function testStartSessionNoRequest(?Request $request): void
{
$requestStack = new RequestStack();

if ($request) {
$requestStack->push($request);
}

$subscriber = new StorefrontSubscriber(
$requestStack,
$this->createMock(RouterInterface::class),
$this->createMock(MaintenanceModeResolver::class),
new StaticSystemConfigService(),
);

$subscriber->startSession();
}

public static function dataProviderStartSession(): \Generator
{
yield 'no request' => [
'request' => null,
'expected' => false,
];

yield 'generic request' => [
'request' => new Request(),
'expected' => false,
];

yield 'storefront request without session' => [
'request' => new Request([], [], [PlatformRequest::ATTRIBUTE_ROUTE_SCOPE => [StorefrontRouteScope::ID]]),
'expected' => false,
];
}

public function testStartSession(): void
{
$request = new Request([], [], [SalesChannelRequest::ATTRIBUTE_IS_SALES_CHANNEL_REQUEST => true, PlatformRequest::ATTRIBUTE_SALES_CHANNEL_CONTEXT_OBJECT => Generator::createSalesChannelContext()], [], [], ['HTTP_X_REQUESTED_WITH' => 'XMLHttpRequest']);
Expand Down

0 comments on commit 541adc4

Please sign in to comment.