This commit registers new items into admin menu and adds functionality for uploading files.
48 lines
1011 B
PHP
48 lines
1011 B
PHP
<?php
|
|
|
|
class WritePermissionsTest extends TestCase
|
|
{
|
|
public function testStorageDir()
|
|
{
|
|
$this->writeToDir(storage_path('test.txt'));
|
|
}
|
|
|
|
public function testLogsDir()
|
|
{
|
|
$this->writeToDir(storage_path('logs/test.txt'));
|
|
}
|
|
|
|
public function testFrameworkDir()
|
|
{
|
|
$this->writeToDir(storage_path('framework/test.txt'));
|
|
}
|
|
|
|
public function testBootstrapCacheDir()
|
|
{
|
|
$this->writeToDir(storage_path('../bootstrap/cache/test.txt'));
|
|
}
|
|
|
|
public function testUploadDir()
|
|
{
|
|
$this->writeToDir(config('app.upload_path').'/test.txt');
|
|
}
|
|
|
|
/**
|
|
* Create and delete some file
|
|
*
|
|
* @param $path
|
|
*/
|
|
protected function writeToDir($file)
|
|
{
|
|
$content = uniqid();
|
|
$bytesWritten = file_put_contents($file, $content);
|
|
|
|
// test writing
|
|
$this->assertNotFalse($bytesWritten);
|
|
|
|
// test deleting
|
|
$deleted = @unlink($file);
|
|
$this->assertTrue($deleted);
|
|
}
|
|
}
|