blessing-skin-server/tests/ServicesTest/WebpackTest.php
2019-09-07 10:18:24 +08:00

26 lines
721 B
PHP

<?php
namespace Tests;
use Illuminate\Filesystem\Filesystem;
class WebpackTest extends TestCase
{
public function testManifest()
{
$this->mock(Filesystem::class, function ($mock) {
$mock->shouldReceive('exists')
->with(public_path('app/manifest.json'))
->once()
->andReturn(true);
$mock->shouldReceive('get')
->with(public_path('app/manifest.json'))
->once()
->andReturn(json_encode(['a' => 'b']));
});
$this->assertEquals('b', resolve(\App\Services\Webpack::class)->{'a'});
$this->assertEquals('', resolve(\App\Services\Webpack::class)->{'nope'});
}
}