resize(Resize::fill(300, 400)); } public function testAssetTransformation() { self::assertEquals( self::$expectedTStr, (string)(new AssetTransformation(self::$t)) ); } public function testAssetTransformationWithExt() { self::assertEquals( self::$expectedTStr . '/' . Format::JPG, (string)(new AssetTransformation(self::$t, Format::JPG)) ); } public function testAssetTransformationWithEmptyExt() { self::assertEquals( self::$expectedTStr . '/', (string)(new AssetTransformation(self::$t, '')) ); } public function testAssetTransformationFromParams() { $params = [ 'crop' => 'fill', 'width' => 300, 'height' => 400, ]; self::assertEquals( self::$expectedTStr, (string)(new AssetTransformation($params)) ); $params['format'] = Format::JPG; self::assertEquals( self::$expectedTStr . '/' . Format::JPG, (string)(new AssetTransformation($params)) ); self::assertEquals( self::$expectedTStr . '/' . Format::JPG, (string)AssetTransformation::fromParams($params) ); $params['format'] = ''; self::assertEquals( self::$expectedTStr . '/', (string)(new AssetTransformation($params)) ); } }