1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/tests/IsAbsolutePathTest.php
Bruce Weirdan 1b0158ad72 Fixed vimeo/psalm#1714 (#1715)
* Fixed vimeo/psalm#1714

Moved `isAbsolutePath()` into a functions file (`src/functions.php`)
that is now automatically loaded by composer autoload.

/cc: @jwage

* Dropped redundant bootstrap
2019-06-01 08:26:22 -04:00

35 lines
872 B
PHP

<?php
namespace Psalm\Tests;
class IsAbsolutePathTest extends TestCase
{
/**
* @param string $path
* @param bool $expected
*
* @return void
*
* @dataProvider providerForTestIsAbsolutePath
*/
public function testIsAbsolutePath($path, $expected)
{
self::assertSame($expected, isAbsolutePath($path));
}
/**
* @return array<int, array{0:string, 1:bool}>
*/
public function providerForTestIsAbsolutePath()
{
return [
['/path/to/something', true],
['/path/to/something/file.php', true],
['relative/path/to/something', false],
['relative/path/to/something/file.php', false],
['c:/path/to/something', true],
['file://c:/path/to/something', true],
['zlib://c:/path/to/something', true],
];
}
}