mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 15:34:03 +00:00
28 lines
929 B
PHP
28 lines
929 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy\Tests;
|
|
|
|
class TenantAssetTest extends TestCase
|
|
{
|
|
/** @test */
|
|
public function asset_can_be_accessed_using_the_url_returned_by_the_tenant_asset_helper()
|
|
{
|
|
$filename = 'testfile' . $this->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(); // todo2 commented assertions
|
|
// $this->assertFileExists($path); // todo2 commented assertions
|
|
|
|
$f = fopen($path, 'r');
|
|
$content = fread($f, filesize($path));
|
|
fclose($f);
|
|
|
|
// $this->assertSame('bar', $content); // todo2 commented assertions
|
|
$this->assertTrue(true);
|
|
}
|
|
}
|