2015-12-13 04:42:28 +00:00
|
|
|
<?php
|
|
|
|
|
2017-02-14 06:53:02 +00:00
|
|
|
namespace Tests\Feature;
|
|
|
|
|
2015-12-13 04:42:28 +00:00
|
|
|
use App\Models\Setting;
|
2016-05-30 05:52:02 +00:00
|
|
|
use App\Models\User;
|
2016-05-27 09:07:52 +00:00
|
|
|
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
2017-02-14 06:53:02 +00:00
|
|
|
use Media;
|
2015-12-13 04:42:28 +00:00
|
|
|
|
2017-08-05 16:56:11 +00:00
|
|
|
class SettingTest extends TestCase
|
2015-12-13 04:42:28 +00:00
|
|
|
{
|
2017-08-05 16:56:11 +00:00
|
|
|
use WithoutMiddleware;
|
2015-12-13 04:42:28 +00:00
|
|
|
|
2017-08-05 18:55:02 +00:00
|
|
|
/** @test */
|
|
|
|
public function application_setting_is_saved_properly()
|
2016-05-27 09:07:52 +00:00
|
|
|
{
|
|
|
|
Media::shouldReceive('sync')->once();
|
|
|
|
|
2017-02-14 06:53:02 +00:00
|
|
|
$user = factory(User::class, 'admin')->create();
|
2017-12-09 18:34:27 +00:00
|
|
|
$this->postAsUser('/api/settings', ['media_path' => __DIR__], $user)->seeStatusCode(200);
|
2016-05-27 09:07:52 +00:00
|
|
|
|
2016-11-24 04:07:57 +00:00
|
|
|
$this->assertEquals(__DIR__, Setting::get('media_path'));
|
2016-05-27 09:07:52 +00:00
|
|
|
}
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|