silverstripe-environmentcheck/tests/Checks/FileWritableCheckTest.php
Robbie Averill b9af2d0734 FIX Update config API, Logger alias, dotenv config, remove PHP 5.5, other fixes
Remove PHP 5.5 from Travis configuration. Dotenv used for environment management now,
examples and tests updated to use putenv instead of define. Logger alias update to
LoggerInterface. Update mutable config API calls. Replace array declaration with
short version: []. Update license year.
2017-05-04 16:11:25 +12:00

39 lines
854 B
PHP

<?php
namespace SilverStripe\EnvironmentCheck\Tests\Checks;
use SilverStripe\EnvironmentCheck\Checks\FileWriteableCheck;
use SilverStripe\EnvironmentCheck\EnvironmentCheck;
use SilverStripe\Dev\SapphireTest;
/**
* Class FileWritableCheckTest
*
* @mixin PHPUnit_Framework_TestCase
*
* @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]);
}
}