mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
First TenantAssetTest
This commit is contained in:
parent
22fc843ce3
commit
9ec4fd931a
2 changed files with 13 additions and 3 deletions
|
|
@ -7,9 +7,19 @@ class TenantAssetTest extends TestCase
|
|||
/** @test */
|
||||
public function asset_can_be_accessed_using_the_url_returned_by_the_tenant_asset_helper()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
$filename = 'testfile' . $this->randomString(10);
|
||||
\Storage::disk('public')->put($filename, 'bar');
|
||||
$this->get(tenant_asset($filename))->assertSee('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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue