2020-02-02 15:15:08 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkioApiTest\Shlink\Rest\Utils;
|
|
|
|
|
2023-06-18 11:36:45 +03:00
|
|
|
class ApiTestDataProviders
|
2020-02-02 15:15:08 +03:00
|
|
|
{
|
2023-06-18 11:36:45 +03:00
|
|
|
public static function invalidUrlsProvider(): iterable
|
2020-02-02 15:15:08 +03:00
|
|
|
{
|
2021-01-10 11:02:05 +03:00
|
|
|
yield 'invalid shortcode' => ['invalid', null, 'No URL found with short code "invalid"', 'valid_api_key'];
|
2020-02-02 21:15:14 +03:00
|
|
|
yield 'invalid shortcode without domain' => [
|
2020-02-02 15:15:08 +03:00
|
|
|
'abc123',
|
|
|
|
'example.com',
|
|
|
|
'No URL found with short code "abc123" for domain "example.com"',
|
2021-01-10 11:02:05 +03:00
|
|
|
'valid_api_key',
|
2020-02-02 15:15:08 +03:00
|
|
|
];
|
2023-06-18 11:36:45 +03:00
|
|
|
yield 'invalid shortcode and custom domain' => [
|
2020-02-02 21:15:14 +03:00
|
|
|
'custom-with-domain',
|
|
|
|
'example.com',
|
|
|
|
'No URL found with short code "custom-with-domain" for domain "example.com"',
|
2021-01-10 11:02:05 +03:00
|
|
|
'valid_api_key',
|
|
|
|
];
|
|
|
|
yield 'valid shortcode with invalid API key' => [
|
|
|
|
'ghi789',
|
|
|
|
null,
|
|
|
|
'No URL found with short code "ghi789"',
|
|
|
|
'author_api_key',
|
|
|
|
];
|
2023-06-18 11:36:45 +03:00
|
|
|
yield 'valid shortcode and custom domain with invalid API key' => [
|
2021-01-10 11:02:05 +03:00
|
|
|
'custom-with-domain',
|
|
|
|
'some-domain.com',
|
|
|
|
'No URL found with short code "custom-with-domain" for domain "some-domain.com"',
|
|
|
|
'domain_api_key',
|
2020-02-02 21:15:14 +03:00
|
|
|
];
|
2020-02-02 15:15:08 +03:00
|
|
|
}
|
|
|
|
}
|