File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
tests/unit/Providers/Models/DTO Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -729,12 +729,12 @@ protected function validateMediaOrientationAspectRatioCompatibility(
729729 MediaOrientationEnum $ orientation ,
730730 string $ aspectRatio
731731 ): void {
732- if ($ orientation ->isSquare () && $ aspectRatio !== '1:1 ' ) {
732+ $ aspectRatioParts = explode (': ' , $ aspectRatio );
733+ if ($ orientation ->isSquare () && $ aspectRatioParts [0 ] !== $ aspectRatioParts [1 ]) {
733734 throw new InvalidArgumentException (
734735 'The aspect ratio " ' . $ aspectRatio . '" is not compatible with the square orientation. '
735736 );
736737 }
737- $ aspectRatioParts = explode (': ' , $ aspectRatio );
738738 if ($ orientation ->isLandscape () && $ aspectRatioParts [0 ] <= $ aspectRatioParts [1 ]) {
739739 throw new InvalidArgumentException (
740740 'The aspect ratio " ' . $ aspectRatio . '" is not compatible with the landscape orientation. '
Original file line number Diff line number Diff line change @@ -715,6 +715,15 @@ public function testMediaOrientationAspectRatioCompatibilitySquare(): void
715715 $ config ->setOutputMediaOrientation (MediaOrientationEnum::square ());
716716 }
717717
718+ public function testMediaOrientationAspectRatioCompatibilitySquareNonNormalized (): void
719+ {
720+ $ config = new ModelConfig ();
721+ $ config ->setOutputMediaOrientation (MediaOrientationEnum::square ());
722+ $ config ->setOutputMediaAspectRatio ('16:16 ' );
723+
724+ $ this ->assertSame ('16:16 ' , $ config ->getOutputMediaAspectRatio ());
725+ }
726+
718727 public function testMediaOrientationAspectRatioCompatibilityLandscape (): void
719728 {
720729 $ config = new ModelConfig ();
You can’t perform that action at this time.
0 commit comments