From a46d1e4c46db963594cfddaf000d87f76a7b7d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pudil?= Date: Fri, 6 Sep 2019 09:20:01 +0200 Subject: [PATCH] use platform-specific directory separator in tests --- tests/Framework/Assert.snapshot.phpt | 2 +- tests/Framework/Assert.snapshot.update.phpt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/Framework/Assert.snapshot.phpt b/tests/Framework/Assert.snapshot.phpt index 2b23044f..6e000212 100644 --- a/tests/Framework/Assert.snapshot.phpt +++ b/tests/Framework/Assert.snapshot.phpt @@ -8,7 +8,7 @@ use Tester\Snapshot; require __DIR__ . '/../bootstrap.php'; -Snapshot::$snapshotDir = __DIR__ . '/fixtures'; +Snapshot::$snapshotDir = __DIR__ . DIRECTORY_SEPARATOR . 'fixtures'; Assert::snapshot('existingSnapshot', ['answer' => 42]); diff --git a/tests/Framework/Assert.snapshot.update.phpt b/tests/Framework/Assert.snapshot.update.phpt index 3b7078ad..66d9fba6 100644 --- a/tests/Framework/Assert.snapshot.update.phpt +++ b/tests/Framework/Assert.snapshot.update.phpt @@ -10,27 +10,27 @@ use Tester\Snapshot; require __DIR__ . '/../bootstrap.php'; putenv(Environment::UPDATE_SNAPSHOTS . '=1'); -Snapshot::$snapshotDir = __DIR__ . '/snapshots'; +Snapshot::$snapshotDir = __DIR__ . DIRECTORY_SEPARATOR . 'snapshots'; Helpers::purge(Snapshot::$snapshotDir); // newly created -Assert::false(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.newSnapshot.phps')); +Assert::false(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.newSnapshot.phps')); Assert::snapshot('newSnapshot', ['answer' => 42]); -Assert::true(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.newSnapshot.phps')); -Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . '/Assert.snapshot.update.newSnapshot.phps')); +Assert::true(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.newSnapshot.phps')); +Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.newSnapshot.phps')); // existing file_put_contents( - Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps', + Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps', ' 43);' . PHP_EOL ); -Assert::true(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps')); +Assert::true(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps')); Assert::snapshot('updatedSnapshot', ['answer' => 42]); -Assert::true(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps')); -Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps')); +Assert::true(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps')); +Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps')); // Snapshot::$updatedSnapshots