FEATURE #1337: add file upload
This commit registers new items into admin menu and adds functionality for uploading files.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user