$user = \App\Models\User::factory()
->create();
$user
->addMedia(resource_path('dummy.pdf'))
->preservingOriginal()
->toMediaCollection();
$path = $user->getFirstMediaPath(conversionName: 'preview');
[$width, $height] = getimagesize($path);
$this->assertEquals(300, $width, 'The width of the conversion is not 300px.');
$this->assertEquals(300, $height, 'The height of the conversion is not 300px.');
The generated conversion is incorrect. Here are results from failed assertions:
1) The width of the conversion is not 300px.
Failed asserting that 1190 matches expected 300.
Expected :300
Actual :1190
2) The height of the conversion is not 300px.
Failed asserting that 1684 matches expected 300.
Expected :300
Actual :1684
Continuation of #3465.
With following configuration in User.php model:
Given the following test case: ExampleTest.php
The generated conversion is incorrect. Here are results from failed assertions:
Repository with test app: kduma-archive/test-laravel-medialibrary-failing-pdf