mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-28 20:29:15 +02:00
Minor cleanup of DirectorTest
This commit is contained in:
parent
3a007d52e6
commit
3c532cea0c
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\Control\Tests;
|
||||
|
||||
use SilverStripe\Control\Cookie_Backend;
|
||||
@ -193,24 +194,26 @@ class DirectorTest extends SapphireTest
|
||||
|
||||
/**
|
||||
* Tests that {@link Director::is_absolute()} works under different environment types
|
||||
* @dataProvider provideAbsolutePaths
|
||||
*/
|
||||
public function testIsAbsolute()
|
||||
public function testIsAbsolute($path, $result)
|
||||
{
|
||||
$expected = array (
|
||||
'C:/something' => true,
|
||||
'd:\\' => true,
|
||||
'e/' => false,
|
||||
's:/directory' => true,
|
||||
'/var/www' => true,
|
||||
'\\Something' => true,
|
||||
'something/c:' => false,
|
||||
'folder' => false,
|
||||
'a/c:/' => false
|
||||
);
|
||||
|
||||
foreach ($expected as $path => $result) {
|
||||
$this->assertEquals(Director::is_absolute($path), $result, "Test result for $path");
|
||||
$this->assertEquals($result, Director::is_absolute($path));
|
||||
}
|
||||
|
||||
public function provideAbsolutePaths()
|
||||
{
|
||||
return [
|
||||
['C:/something', true],
|
||||
['d:\\', true],
|
||||
['e/', false],
|
||||
['s:/directory', true],
|
||||
['/var/www', true],
|
||||
['\\Something', true],
|
||||
['something/c:', false],
|
||||
['folder', false],
|
||||
['a/c:/', false],
|
||||
];
|
||||
}
|
||||
|
||||
public function testIsAbsoluteUrl()
|
||||
|
Loading…
Reference in New Issue
Block a user