mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
37 lines
814 B
PHP
37 lines
814 B
PHP
<?php
|
|
|
|
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
|
|
|
|
use SilverStripe\EnvironmentCheck\Checks\FileWriteableCheck;
|
|
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
/**
|
|
* Class FileWritableCheckTest
|
|
*
|
|
* @package environmentcheck
|
|
*/
|
|
class FileWritableCheckTest extends SapphireTest
|
|
{
|
|
public function testCheckReportsWritablePaths()
|
|
{
|
|
$check = new FileWriteableCheck(TEMP_FOLDER);
|
|
|
|
$expected = [
|
|
EnvironmentCheck::OK,
|
|
''
|
|
];
|
|
|
|
$this->assertEquals($expected, $check->check());
|
|
}
|
|
|
|
public function testCheckReportsNonWritablePaths()
|
|
{
|
|
$check = new FileWriteableCheck('/var');
|
|
|
|
$result = $check->check();
|
|
|
|
$this->assertEquals(EnvironmentCheck::ERROR, $result[0]);
|
|
}
|
|
}
|