Skip to content

Commit a46d1e4

Browse files
committed
use platform-specific directory separator in tests
1 parent a3e5247 commit a46d1e4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/Framework/Assert.snapshot.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use Tester\Snapshot;
88

99
require __DIR__ . '/../bootstrap.php';
1010

11-
Snapshot::$snapshotDir = __DIR__ . '/fixtures';
11+
Snapshot::$snapshotDir = __DIR__ . DIRECTORY_SEPARATOR . 'fixtures';
1212

1313
Assert::snapshot('existingSnapshot', ['answer' => 42]);
1414

tests/Framework/Assert.snapshot.update.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@ use Tester\Snapshot;
1010
require __DIR__ . '/../bootstrap.php';
1111

1212
putenv(Environment::UPDATE_SNAPSHOTS . '=1');
13-
Snapshot::$snapshotDir = __DIR__ . '/snapshots';
13+
Snapshot::$snapshotDir = __DIR__ . DIRECTORY_SEPARATOR . 'snapshots';
1414
Helpers::purge(Snapshot::$snapshotDir);
1515

1616
// newly created
1717

18-
Assert::false(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.newSnapshot.phps'));
18+
Assert::false(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.newSnapshot.phps'));
1919
Assert::snapshot('newSnapshot', ['answer' => 42]);
20-
Assert::true(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.newSnapshot.phps'));
21-
Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . '/Assert.snapshot.update.newSnapshot.phps'));
20+
Assert::true(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.newSnapshot.phps'));
21+
Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.newSnapshot.phps'));
2222

2323
// existing
2424

2525
file_put_contents(
26-
Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps',
26+
Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps',
2727
'<?php return array(\'answer\' => 43);' . PHP_EOL
2828
);
2929

30-
Assert::true(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps'));
30+
Assert::true(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps'));
3131
Assert::snapshot('updatedSnapshot', ['answer' => 42]);
32-
Assert::true(file_exists(Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps'));
33-
Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . '/Assert.snapshot.update.updatedSnapshot.phps'));
32+
Assert::true(file_exists(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps'));
33+
Assert::contains('42', file_get_contents(Snapshot::$snapshotDir . DIRECTORY_SEPARATOR . 'Assert.snapshot.update.updatedSnapshot.phps'));
3434

3535
// Snapshot::$updatedSnapshots
3636

0 commit comments

Comments
 (0)