Skip to content

Commit ca31096

Browse files
Actually add the test this time
1 parent 25f92ce commit ca31096

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/Uploads/ImageTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,32 @@ public function test_image_file_update()
119119
$this->files->deleteAtRelativePath($relPath);
120120
}
121121

122+
public function test_image_file_update_allows_case_differences()
123+
{
124+
$page = $this->entities->page();
125+
$this->asEditor();
126+
127+
$imgDetails = $this->files->uploadGalleryImageToPage($this, $page);
128+
$relPath = $imgDetails['path'];
129+
130+
$newUpload = $this->files->uploadedImage('updated-image.PNG', 'compressed.png');
131+
$this->assertFileEquals($this->files->testFilePath('test-image.png'), public_path($relPath));
132+
133+
$imageId = $imgDetails['response']->id;
134+
$image = Image::findOrFail($imageId);
135+
$image->updated_at = now()->subMonth();
136+
$image->save();
137+
138+
$this->call('PUT', "/images/{$imageId}/file", [], [], ['file' => $newUpload])
139+
->assertOk();
140+
141+
$this->assertFileEquals($this->files->testFilePath('compressed.png'), public_path($relPath));
142+
143+
$image->refresh();
144+
$this->assertTrue($image->updated_at->gt(now()->subMinute()));
145+
146+
$this->files->deleteAtRelativePath($relPath);
147+
}
122148

123149
public function test_image_file_update_does_not_allow_change_in_image_extension()
124150
{

0 commit comments

Comments
 (0)