randomString(10); \Storage::disk('public')->put($filename, 'bar'); $path = storage_path("app/public/$filename"); // response()->file() returns BinaryFileResponse whose content is // inaccessible via getContent, so ->assertSee() can't be used $this->get(tenant_asset($filename))->assertSuccessful(); $this->assertFileExists($path); $f = fopen($path, 'r'); $content = fread($f, filesize($path)); fclose($f); $this->assertSame('bar', $content); } }