mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 15:05:40 +00:00
* Update composer constraint for 4.x compat * 4.x compatibility: Rename "code" to "src" and add PSR-4 autoloading * Restructure code and tests for PSR-4 * Implement namespaces * Implement namespaced throughout * PSR-2 formatting updates, separate Result from CheckSuite, implement PSR-3 logging, fix tests * FIX Routes and template location * Update readme. Allow check classes to be namespaced or not. * Add entry to changelog * FIX Ensure DatabaseCheckTest always has a member. Allow strings or objects for $check in the suite * Update readme to be clearer about passing checks with or without namespaces * Revert namespace checking and implement Injector aliases instead. Update readme.
39 lines
859 B
PHP
39 lines
859 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 = array(
|
|
EnvironmentCheck::OK,
|
|
''
|
|
);
|
|
|
|
$this->assertEquals($expected, $check->check());
|
|
}
|
|
|
|
public function testCheckReportsNonWritablePaths()
|
|
{
|
|
$check = new FileWriteableCheck('/var');
|
|
|
|
$result = $check->check();
|
|
|
|
$this->assertEquals(EnvironmentCheck::ERROR, $result[0]);
|
|
}
|
|
}
|