Skip to content

Commit 10ff381

Browse files
committed
Better message when skipping tests
Add info about the env vars and config filename when skipping tests. Refs #81
1 parent 70f4ff9 commit 10ff381

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/TestCase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ public function getFlickr(bool $authenticate = false): PhpFlickr
3030
$apiSecret = getenv('FLICKR_API_SECRET');
3131
$accessToken = getenv('FLICKR_ACCESS_TOKEN');
3232
$accessTokenSecret = getenv('FLICKR_ACCESS_SECRET');
33-
if (empty($apiKey) && file_exists(__DIR__ . '/config.php')) {
34-
require __DIR__ . '/config.php';
33+
$configFile = __DIR__ . '/config.php';
34+
if (empty($apiKey) && file_exists($configFile)) {
35+
require $configFile;
3536
}
3637
if (empty($apiKey)) {
3738
// Skip if no key found, so PRs from forks can still be run in CI.
38-
static::markTestSkipped('No Flickr API key set.');
39+
static::markTestSkipped('No Flickr API key set (in either the FLICKR_* env vars or ' . $configFile . ')');
3940
}
4041
try {
4142
$this->flickrs[$authed] = new PhpFlickr($apiKey, $apiSecret);

0 commit comments

Comments
 (0)