Skip to content

Commit

Permalink
Make sure files exist for our fake assets in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Jan 10, 2024
1 parent 28a84ef commit 5dd6647
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/Assets/AssetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ public function it_checks_if_an_extension_matches()
public function it_gets_the_extension_guessed_extension_and_mime_type()
{
Storage::fake('test');
Storage::disk('test')->put('foo.mp4a', '');
Storage::disk('test')->put('.meta/foo.mp4a.yaml', YAML::dump(['mime_type' => 'audio/mp4']));

$container = Facades\AssetContainer::make('test')->disk('test');
Expand Down Expand Up @@ -1415,6 +1416,7 @@ public function it_gets_dimensions_for_svgs()
public function it_gets_no_ratio_when_height_is_zero()
{
Storage::fake('test');
Storage::disk('test')->put('image.jpg', '');
Storage::disk('test')->put('.meta/image.jpg.yaml', YAML::dump(['width' => '30', 'height' => '0']));

$container = Facades\AssetContainer::make('test')->disk('test');
Expand Down Expand Up @@ -2180,6 +2182,7 @@ public function it_syncs_original_state_with_no_data()
/** @test */
public function it_syncs_original_state_with_no_data_but_with_data_in_meta()
{
Storage::disk('test')->put('path/to/test.txt', '');
Storage::disk('test')->put('path/to/.meta/test.txt.yaml', "data:\n foo: bar");
$asset = (new Asset)->container($this->container)->path('path/to/test.txt');

Expand Down Expand Up @@ -2208,6 +2211,7 @@ public function it_syncs_original_state_with_no_data_but_with_data_in_meta()
/** @test */
public function it_syncs_original_state_with_data()
{
Storage::disk('test')->put('path/to/test.txt', '');
$yaml = <<<'YAML'
data:
alfa: bravo
Expand Down Expand Up @@ -2249,6 +2253,7 @@ public function it_syncs_original_state_with_data()
/** @test */
public function it_resolves_pending_original_meta_values_when_hydrating()
{
Storage::disk('test')->put('path/to/test.txt', '');
$yaml = <<<'YAML'
data:
alfa: bravo
Expand Down

0 comments on commit 5dd6647

Please sign in to comment.