create([ 'is_public' => true, 'is_approved' => true, 'published_at' => now()->subDay(), 'file_name' => 'missing-original.jpg', 'file_ext' => 'jpg', 'hash' => str_repeat('ab', 32), ]); $this->mock(ArtworkStatsService::class, function ($mock) { $mock->shouldReceive('incrementDownloads')->never(); }); $this->get('/download/artwork/'.$artwork->id)->assertNotFound(); expect(DB::table('artwork_downloads')->where('artwork_id', $artwork->id)->count())->toBe(0); });