bug68557.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --TEST--
  2. Bug #68557 (SplFileInfo::getPathname() may be broken)
  3. --FILE--
  4. <?php
  5. mkdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
  6. touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'a');
  7. touch(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
  8. $d = new DirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
  9. $d->seek(0);
  10. $path0 = $d->current()->getPathname();
  11. $d->seek(1);
  12. $path1 = $d->current()->getPathname();
  13. $d->seek(2);
  14. $path2 = $d->current()->getPathname();
  15. $d->seek(0);
  16. var_dump($path0 === $d->current()->getPathname());
  17. $d->seek(1);
  18. var_dump($path1 === $d->current()->getPathname());
  19. $d->seek(2);
  20. var_dump($path2 === $d->current()->getPathname());
  21. $d->seek(0);
  22. var_dump($path0 === $d->current()->getPathname());
  23. ?>
  24. --CLEAN--
  25. <?php
  26. unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'a');
  27. unlink(__DIR__ . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . 'b');
  28. rmdir(__DIR__ . DIRECTORY_SEPARATOR . 'tmp');
  29. ?>
  30. --EXPECT--
  31. bool(true)
  32. bool(true)
  33. bool(true)
  34. bool(true)