From 67b4bd1209cc57e0623e7765010dcc396dde6a4c Mon Sep 17 00:00:00 2001 From: Joby Elliott Date: Thu, 1 Oct 2020 13:13:09 -0600 Subject: [PATCH] tests for Original sizer --- tests/units/Sizers/Original.php | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/units/Sizers/Original.php diff --git a/tests/units/Sizers/Original.php b/tests/units/Sizers/Original.php new file mode 100644 index 0000000..a333368 --- /dev/null +++ b/tests/units/Sizers/Original.php @@ -0,0 +1,36 @@ +given($image = $this->image(__DIR__.'/../100x200.jpg')) + ->integer($image->width())->isEqualTo(100) + ->integer($image->height())->isEqualTo(200) + ->variable($image->sizer()->resizeToWidth())->isNull() + ->variable($image->sizer()->resizeToHeight())->isNull() + ->variable($image->sizer()->cropToWidth())->isNull() + ->variable($image->sizer()->cropToHeight())->isNull() + ->given($image->rotate()) + ->integer($image->width())->isEqualTo(200) + ->integer($image->height())->isEqualTo(100) + ->variable($image->sizer()->resizeToWidth())->isNull() + ->variable($image->sizer()->resizeToHeight())->isNull() + ->variable($image->sizer()->cropToWidth())->isNull() + ->variable($image->sizer()->cropToHeight())->isNull() + ; + } + + protected function image(string $path) + { + $driver = new MockDriver(); + return $driver->image($path, new SizerUnderTest()); + } +}