FileSystem.platformSlashes.phpt 436 B

123456789101112131415161718
  1. <?php
  2. declare(strict_types=1);
  3. use Nette\Utils\FileSystem;
  4. use Tester\Assert;
  5. require __DIR__ . '/../bootstrap.php';
  6. test('', function () {
  7. Assert::same(DIRECTORY_SEPARATOR, FileSystem::platformSlashes('\\'));
  8. Assert::same(DIRECTORY_SEPARATOR, FileSystem::platformSlashes('/'));
  9. });
  10. test('protocol', function () {
  11. Assert::same('file://path' . DIRECTORY_SEPARATOR . 'file', FileSystem::platformSlashes('file://path/file'));
  12. });