opendir-004.phpt 701 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. opendir() with 'ftps://' stream.
  3. --EXTENSIONS--
  4. openssl
  5. --SKIPIF--
  6. <?php
  7. if (array_search('ftp',stream_get_wrappers()) === FALSE) die("skip ftp wrapper not available.");
  8. if (!function_exists('pcntl_fork')) die("skip pcntl_fork() not available.");
  9. ?>
  10. --FILE--
  11. <?php
  12. $ssl=true;
  13. require __DIR__ . "/../../../ftp/tests/server.inc";
  14. $path="ftps://127.0.0.1:" . $port."/";
  15. $context = stream_context_create(array('ssl' => array('cafile' => __DIR__ . '/../../../ftp/tests/cert.pem')));
  16. $ds=opendir($path, $context);
  17. var_dump($ds);
  18. while ($fn=readdir($ds)) {
  19. var_dump($fn);
  20. }
  21. ?>
  22. --EXPECTF--
  23. resource(%d) of type (stream)
  24. string(5) "file1"
  25. string(5) "file1"
  26. string(3) "fil"
  27. string(4) "b0rk"