Skip to content

Commit

Permalink
photo add
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Sep 14, 2024
1 parent 1ff3b86 commit ab2cf16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Feature_v1/PhotosAddMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function testImportViaSymlink(): void
$photo_id = $ids_after->diff($ids_before)->first();
/** @var \App\Models\Photo $photo */
$photo = static::convertJsonToObject($this->photos_tests->get($photo_id));
/** @disregard */
$symlink_path = public_path($this->dropUrlPrefix($photo->size_variants->original->url));
$this->assertEquals(true, is_link($symlink_path));
}
Expand Down Expand Up @@ -196,10 +197,13 @@ public function testAppleLivePhotoImportViaSymlink(): void
$photo = static::convertJsonToObject($this->photos_tests->get($photo_id));
$this->assertEquals('E905E6C6-C747-4805-942F-9904A0281F02', $photo->live_photo_content_id);
$this->assertStringEndsWith('.mov', $photo->live_photo_url);
/** @disregard */
$this->assertEquals(pathinfo($photo->live_photo_url, PATHINFO_DIRNAME), pathinfo($photo->size_variants->original->url, PATHINFO_DIRNAME));
/** @disregard */
$this->assertEquals(pathinfo($photo->live_photo_url, PATHINFO_FILENAME), pathinfo($photo->size_variants->original->url, PATHINFO_FILENAME));

// get the paths of the original size variant and the live photo and check whether they are truly symbolic links
/** @disregard */
$symlink_path1 = public_path($this->dropUrlPrefix($photo->size_variants->original->url));
$symlink_path2 = public_path($this->dropUrlPrefix($photo->live_photo_url));
$this->assertEquals(true, is_link($symlink_path1));
Expand Down

0 comments on commit ab2cf16

Please sign in to comment.