1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 17:27:28 +01:00
psalm/tests/IsAbsolutePathTest.php

37 lines
935 B
PHP
Raw Normal View History

2019-05-03 16:27:09 +02:00
<?php
namespace Psalm\Tests;
class IsAbsolutePathTest extends TestCase
{
/**
* @param string $path
* @param bool $expected
*
* @return void
*
* @dataProvider providerForTestIsAbsolutePath
*/
public function testIsAbsolutePath($path, $expected)
{
require_once __DIR__.'/../src/command_functions.php';
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],
];
}
}