CoreMaintenanceModeResolver example



        static::assertSame($expected, CacheResponseSubscriber::getSubscribedEvents());
    }

    public function testNoHeadersAreSetIfCacheIsDisabled(): void
    {
        $subscriber = new CacheResponseSubscriber(
            $this->createMock(CartService::class),
            100,
            false,
            new MaintenanceModeResolver(new RequestStack()new CoreMaintenanceModeResolver(new EventDispatcher())),
            false,
            null,
            null
        );

        $customer = new CustomerEntity();
        $salesChannelContext = $this->createMock(SalesChannelContext::class);
        $salesChannelContext->method('getCustomer')->willReturn($customer);

        $request = new Request();
        $request->attributes->set(PlatformRequest::ATTRIBUTE_SALES_CHANNEL_CONTEXT_OBJECT, $salesChannelContext);

        
use Symfony\Component\HttpFoundation\RequestStack;

/** * @internal * * @covers \Shopware\Storefront\Framework\Routing\MaintenanceModeResolver */
class MaintenanceModeResolverTest extends TestCase
{
    public function testShouldInstantiate(): void
    {
        static::assertInstanceOf(MaintenanceModeResolver::classnew MaintenanceModeResolver($this->getRequestStack()new CoreMaintenanceModeResolver(new EventDispatcher())));
    }

    /** * Tests whether the resolver redirects requests to the maintenance page correctly. * * @dataProvider maintenanceModeInactiveProvider * @dataProvider maintenanceModeActiveProvider * @dataProvider xmlHttpRequestProvider * @dataProvider maintenancePageRequestProvider * @dataProvider errorControllerRequestProvider */
    
Home | Imprint | This part of the site doesn't use cookies.