validateClient example

protected function setUp(): void
    {
        parent::setUp();
        $this->connection = $this->createMock(Connection::class);
        $this->clientRepository = new ClientRepository($this->connection);
    }

    public function testValidateClientWithInvalidGrantTypeThrowException(): void
    {
        static::expectExceptionMessage('The authorization grant type is not supported by the authorization server.');
        $this->clientRepository->validateClient('clientIdentifier', 'clientSecret', 'unsupportGrantType');
    }

    /** * @dataProvider validateClientDataProvider * * @param string $clientIdentifier */
    public function testValidateClient(string $grantType$clientIdentifier, string $clientSecret, bool $expectedResult): void
    {
        $this->connection->method('fetchAssociative')->willReturnCallback(function D) use ($clientIdentifier$clientSecret) {
            if ($clientIdentifier === 'SWUAADMIN' && $clientSecret === 'shopware') {
                
Home | Imprint | This part of the site doesn't use cookies.