mock(Filesystem::class, function ($mock) { $mock->shouldReceive('put') ->with(storage_path('install.lock'), '') ->once() ->andReturn(true); }); Cache::partialMock()->shouldReceive('flush')->once(); option(['version' => '0.0.0']); config([ 'app.version' => '0.0.1', 'translation-loader.translation_loaders' => [], ]); $this->artisan('update') ->expectsOutput(trans('setup.updates.success.title')); $this->assertEquals('0.0.1', option('version')); Event::assertDispatched('__0.0.1'); } }