Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuablum committed Oct 13, 2023
1 parent f2860cb commit 591c682
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/Assets/AssetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1830,10 +1830,10 @@ public function it_appends_timestamp_to_uploaded_files_filename_if_it_already_ex
public function it_lowercases_uploaded_filenames_by_default()
{
Event::fake();
$asset = $this->container->makeAsset('path/to/lowercase-THIS-asset.jpg');
$asset = $this->container->makeAsset('path/to/lowercase-THIS-asset.JPG');
Facades\AssetContainer::shouldReceive('findByHandle')->with('test_container')->andReturn($this->container);

$asset->upload(UploadedFile::fake()->image('lowercase-THIS-asset.jpg'));
$asset->upload(UploadedFile::fake()->image('lowercase-THIS-asset.JPG'));

Storage::disk('test')->assertExists('path/to/lowercase-this-asset.jpg');
$this->assertEquals('path/to/lowercase-this-asset.jpg', $asset->path());
Expand Down Expand Up @@ -1913,13 +1913,13 @@ public function it_doesnt_lowercase_uploaded_filenames_when_configured()
config(['statamic.assets.lowercase' => false]);

Event::fake();
$asset = $this->container->makeAsset('path/to/do-NOT-lowercase-THIS-asset.jpg');
$asset = $this->container->makeAsset('path/to/do-NOT-lowercase-THIS-asset.JPG');
Facades\AssetContainer::shouldReceive('findByHandle')->with('test_container')->andReturn($this->container);

$asset->upload(UploadedFile::fake()->image('do-NOT-lowercase-THIS-asset.jpg'));
$asset->upload(UploadedFile::fake()->image('do-NOT-lowercase-THIS-asset.JPG'));

Storage::disk('test')->assertExists('path/to/do-NOT-lowercase-THIS-asset.jpg');
$this->assertEquals('path/to/do-NOT-lowercase-THIS-asset.jpg', $asset->path());
Storage::disk('test')->assertExists('path/to/do-NOT-lowercase-THIS-asset.JPG');
$this->assertEquals('path/to/do-NOT-lowercase-THIS-asset.JPG', $asset->path());
Event::assertDispatched(AssetUploaded::class, function ($event) use ($asset) {
return $event->asset = $asset;
});
Expand Down

0 comments on commit 591c682

Please sign in to comment.