FEATURE #1337: add file upload

This commit registers new items into admin menu and adds functionality for uploading files.
This commit is contained in:
Michal Kváček
2016-02-08 14:27:43 +01:00
parent 58a3386277
commit 24144f6aa4
19 changed files with 489 additions and 53 deletions
+11 -7
View File
@@ -4,22 +4,27 @@ class WritePermissionsTest extends TestCase
{
public function testStorageDir()
{
$this->writeToDir('test.txt');
$this->writeToDir(storage_path('test.txt'));
}
public function testLogsDir()
{
$this->writeToDir('logs/test.txt');
$this->writeToDir(storage_path('logs/test.txt'));
}
public function testFrameworkDir()
{
$this->writeToDir('framework/test.txt');
$this->writeToDir(storage_path('framework/test.txt'));
}
public function testBootstrapCacheDir()
{
$this->writeToDir('../bootstrap/cache/test.txt');
$this->writeToDir(storage_path('../bootstrap/cache/test.txt'));
}
public function testUploadDir()
{
$this->writeToDir(config('app.upload_path').'/test.txt');
}
/**
@@ -27,11 +32,10 @@ class WritePermissionsTest extends TestCase
*
* @param $path
*/
protected function writeToDir($path)
protected function writeToDir($file)
{
$file = storage_path($path);
$content = uniqid();
$bytesWritten = @file_put_contents($file, $content);
$bytesWritten = file_put_contents($file, $content);
// test writing
$this->assertNotFalse($bytesWritten);