silverstripe-environmentcheck/tests/checks/FileWritableCheckTest.php

29 lines
590 B
PHP
Raw Normal View History

2015-09-10 23:13:48 +02:00
<?php
/**
* @mixin PHPUnit_Framework_TestCase
*/
2015-11-21 07:18:35 +01:00
class FileWritableCheckTest extends SapphireTest
{
public function testCheckReportsWritablePaths()
{
$check = new FileWriteableCheck(TEMP_FOLDER);
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$expected = array(
EnvironmentCheck::OK,
'',
);
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$this->assertEquals($expected, $check->check());
}
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
public function testCheckReportsNonWritablePaths()
{
$check = new FileWriteableCheck('/var');
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$result = $check->check();
2015-09-10 23:13:48 +02:00
2015-11-21 07:18:35 +01:00
$this->assertEquals(EnvironmentCheck::ERROR, $result[0]);
}
2015-09-10 23:13:48 +02:00
}