Skip to content

Commit

Permalink
nitpick
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Dec 11, 2023
1 parent 0e6e6e1 commit fbce0aa
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
7 changes: 5 additions & 2 deletions tests/TestSupport/TestModels/TestModelWithConversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ class TestModelWithConversion extends TestModel
{
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
$this
->addMediaConversion('thumb')
->width(50)
->height(50)
->nonQueued();

$this->addMediaConversion('keep_original_format')
$this
->addMediaConversion('keep_original_format')
->keepOriginalImageFormat()
->nonQueued();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ class TestModelWithConversionQueued extends TestModel
{
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
$this
->addMediaConversion('thumb')
->width(50);

$this->addMediaConversion('avatar_thumb')
$this
->addMediaConversion('avatar_thumb')
->performOnCollections('avatar')
->width(50);

$this->addMediaConversion('keep_original_format')
$this
->addMediaConversion('keep_original_format')
->keepOriginalImageFormat();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class TestModelWithConversionsOnOtherDisk extends TestModel
{
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
$this
->addMediaConversion('thumb')
->withResponsiveImages()
->width(50)
->nonQueued();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ class TestModelWithMultipleConversions extends TestModel
{
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('small')
$this
->addMediaConversion('small')
->width(50)
->nonQueued();

$this->addMediaConversion('medium')
$this
->addMediaConversion('medium')
->width(100)
->nonQueued();

$this->addMediaConversion('large')
$this
->addMediaConversion('large')
->width(200)
->nonQueued();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class TestModelWithPreviewConversion extends TestModel
{
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('preview')
$this
->addMediaConversion('preview')
->fit(Fit::Contain, 300, 300)
->nonQueued();
}
Expand Down
15 changes: 10 additions & 5 deletions tests/TestSupport/TestModels/TestModelWithResponsiveImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ class TestModelWithResponsiveImages extends TestModel
{
public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')
$this
->addMediaConversion('thumb')
->withResponsiveImages()
->width(50)
->nonQueued();

$this->addMediaConversion('otherImageConversion')
$this
->addMediaConversion('otherImageConversion')
->greyscale();

$this->addMediaConversion('pngtojpg')
$this
->addMediaConversion('pngtojpg')
->width(700)
->quality(1)
->background('#ff00ff')
->format('jpg')
->withResponsiveImages();

$this->addMediaConversion('lowerQuality')
$this
->addMediaConversion('lowerQuality')
->withResponsiveImages()
->quality(60)
->nonQueued();

$this->addMediaConversion('standardQuality')
$this
->addMediaConversion('standardQuality')
->withResponsiveImages()
->nonQueued();
}
Expand Down

0 comments on commit fbce0aa

Please sign in to comment.