silverstripe-environmentcheck/tests/checks/FileWritableCheckTest.php
2015-11-21 19:18:35 +13:00

29 lines
590 B
PHP

<?php
/**
* @mixin PHPUnit_Framework_TestCase
*/
class FileWritableCheckTest extends SapphireTest
{
public function testCheckReportsWritablePaths()
{
$check = new FileWriteableCheck(TEMP_FOLDER);
$expected = array(
EnvironmentCheck::OK,
'',
);
$this->assertEquals($expected, $check->check());
}
public function testCheckReportsNonWritablePaths()
{
$check = new FileWriteableCheck('/var');
$result = $check->check();
$this->assertEquals(EnvironmentCheck::ERROR, $result[0]);
}
}