invalidAccessKeyIdentifier example



    public function testInvalidAccessKey(): void
    {
        $exception = ApiException::invalidAccessKey();

        static::assertEquals(ApiException::API_INVALID_ACCESS_KEY_EXCEPTION, $exception->getErrorCode());
    }

    public function testInvalidAccessKeyIdentifier(): void
    {
        $exception = ApiException::invalidAccessKeyIdentifier();

        static::assertEquals(ApiException::API_INVALID_ACCESS_KEY_IDENTIFIER_EXCEPTION, $exception->getErrorCode());
    }

    public function testSalesChannelInMaintenanceMode(): void
    {
        $exception = ApiException::salesChannelInMaintenanceMode();

        static::assertEquals(ApiException::API_SALES_CHANNEL_MAINTENANCE_MODE, $exception->getErrorCode());
    }
}
throw ApiException::invalidAccessKey();
        }

        return self::$mapping[$identifier];
    }

    private static function getIdentifier(string $origin): string
    {
        $mapping = array_flip(self::$mapping);

        if (!isset($mapping[$origin])) {
            throw ApiException::invalidAccessKeyIdentifier();
        }

        return $mapping[$origin];
    }
}
Home | Imprint | This part of the site doesn't use cookies.