setCustomerGroupSearchReturn example


    public function testGroupRegistrationAcceptMatches(?int $expectedResCode, ?array $customers, Request $request, ?string $errorMessage): void
    {
        $context = Context::createDefaultContext();

        if ($customers !== null) {
            $customerCollection = new CustomerCollection($customers);
            $this->setRestorerReturn();
            $this->setSearchReturn($context$customerCollection);
            $this->setCustomerGroupSearchReturn($context);
        }

        if ($errorMessage !== null && $expectedResCode === null) {
            static::expectExceptionMessage($errorMessage);
        }

        $res = $this->controllerMock->accept($request$context);
        static::assertSame($expectedResCode$res->getStatusCode());
    }

    /** * @param CustomerEntity[] $customers * * @dataProvider getRegistrationValues * * @throws Exception */
Home | Imprint | This part of the site doesn't use cookies.