mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-02-17 14:49:27 +08:00
29 lines
897 B
PHP
29 lines
897 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Filesystem\Filesystem;
|
|
use Illuminate\Support\Str;
|
|
|
|
class OptionsCacheCommandTest extends TestCase
|
|
{
|
|
public function testRun()
|
|
{
|
|
$this->mock(Filesystem::class, function ($mock) {
|
|
$mock->shouldReceive('exists')->andReturn(false);
|
|
$mock->shouldReceive('delete')->with(storage_path('options.php'))->once();
|
|
$mock->shouldReceive('put')
|
|
->withArgs(function ($path, $content) {
|
|
$this->assertEquals(storage_path('options.php'), $path);
|
|
$this->assertTrue(Str::startsWith($content, '<?php'.PHP_EOL));
|
|
$this->assertTrue(Str::endsWith($content, ';'));
|
|
|
|
return true;
|
|
})
|
|
->once();
|
|
});
|
|
|
|
$this->artisan('options:cache')->expectsOutput('Options cached successfully.');
|
|
}
|
|
}
|