|
3 | 3 | namespace Square\Tests\Integration; |
4 | 4 |
|
5 | 5 | use PHPUnit\Framework\TestCase; |
6 | | -use RuntimeException; |
7 | 6 | use Square\Environments; |
8 | 7 | use Square\Reporting\Requests\LoadRequest; |
9 | 8 | use Square\SquareClient; |
|
18 | 17 | * The Reporting API is **production only** — it is not available in sandbox |
19 | 18 | * (sandbox host → 404, sandbox token against production → 401) — and requires a |
20 | 19 | * reporting-provisioned token. To avoid breaking the default CI run, the whole |
21 | | - * suite is skipped unless `TEST_SQUARE_REPORTING` is set. When enabled it reuses |
22 | | - * the same `TEST_SQUARE_TOKEN` as the other integration tests, but points at the |
23 | | - * production environment. |
| 20 | + * suite is skipped unless `TEST_SQUARE_REPORTING` is set. When enabled, |
| 21 | + * `TEST_SQUARE_REPORTING` itself supplies the production reporting-provisioned |
| 22 | + * access token used to authenticate against the production environment |
| 23 | + * (`TEST_SQUARE_REPORTING=<prod-reporting-token>`). |
24 | 24 | */ |
25 | 25 | class ReportingTest extends TestCase |
26 | 26 | { |
27 | 27 | private static SquareClient $client; |
28 | 28 |
|
29 | 29 | public static function setUpBeforeClass(): void |
30 | 30 | { |
31 | | - if (!getenv('TEST_SQUARE_REPORTING')) { |
32 | | - self::markTestSkipped('Set TEST_SQUARE_REPORTING (with a production reporting token in TEST_SQUARE_TOKEN) to run the Reporting API live tests.'); |
33 | | - } |
34 | | - |
35 | | - $token = getenv('TEST_SQUARE_TOKEN'); |
| 31 | + $token = getenv('TEST_SQUARE_REPORTING'); |
36 | 32 | if (!$token) { |
37 | | - throw new RuntimeException('TEST_SQUARE_TOKEN environment variable is not set.'); |
| 33 | + self::markTestSkipped('Set TEST_SQUARE_REPORTING=<prod-reporting-token> to run the Reporting API live tests against production.'); |
38 | 34 | } |
39 | 35 |
|
40 | 36 | self::$client = new SquareClient( |
|
0 commit comments