BaseTestCase.php 641 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of Chrome PHP.
  4. *
  5. * (c) Soufiane Ghzal <sghzal@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace HeadlessChromium\Test;
  11. use PHPUnit\Framework\TestCase;
  12. class BaseTestCase extends TestCase
  13. {
  14. protected static function sitePath(string $file): string
  15. {
  16. $path = \realpath(__DIR__.'/resources/static-web/'.$file);
  17. if (\DIRECTORY_SEPARATOR == '\\') {
  18. $path = '/'.\str_replace('\\', '/', $path); // Windows compatibility
  19. }
  20. return 'file://'.$path;
  21. }
  22. }