Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests on macOS #1120

Merged
merged 3 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 16 additions & 37 deletions tests/Phar/PharMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace KevinGH\Box\Phar;

use KevinGH\Box\Platform;
use Phar;
use PHPUnit\Framework\TestCase;
use function rtrim;
Expand Down Expand Up @@ -403,45 +402,25 @@ public static function pharProvider(): iterable
}

if (extension_loaded('zlib')) {
yield 'ZIP compressed simple tar' => Platform::isOSX()
? [
self::FIXTURES_DIR.'/../phar/simple.zip',
yield 'ZIP compressed simple tar' => [
self::FIXTURES_DIR.'/../phar/simple.zip',
null,
new PharMeta(
CompressionAlgorithm::NONE,
null,
new PharMeta(
CompressionAlgorithm::NONE,
null,
null,
null,
null,
1680284660,
null,
[
'sample.txt' => [
'compression' => CompressionAlgorithm::GZ,
'compressedSize' => 15,
],
],
),
]
: [
self::FIXTURES_DIR.'/../phar/simple.zip',
null,
new PharMeta(
CompressionAlgorithm::NONE,
null,
null,
null,
null,
1680291860,
null,
[
'sample.txt' => [
'compression' => CompressionAlgorithm::GZ,
'compressedSize' => 15,
],
null,
null,
1680284660,
null,
[
'sample.txt' => [
'compression' => CompressionAlgorithm::GZ,
'compressedSize' => 15,
],
),
];
],
),
];
}

if (extension_loaded('bz2')) {
Expand Down
2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@

$_SERVER['BOX_BIN'] = $_ENV['BOX_BIN'] = $binBoxPath;
putenv('BOX_BIN='.$binBoxPath);
// Some tests depend on timezone: https://github.com/php/php-src/issues/12532
putenv('TZ=GMT-2');
Loading