Completed
Push — master ( 3747ae...9b0aba )
by Aimeos
08:08
created
lib/mwlib/tests/MW/Media/Image/StandardTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	public function testConstructGif()
16 16
 	{
17 17
 		$ds = DIRECTORY_SEPARATOR;
18
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.gif' );
18
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.gif' );
19 19
 
20 20
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/gif', array() );
21 21
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	public function testConstructJpeg()
27 27
 	{
28 28
 		$ds = DIRECTORY_SEPARATOR;
29
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.jpg' );
29
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.jpg' );
30 30
 
31 31
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/jpeg', array() );
32 32
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	public function testConstructPng()
38 38
 	{
39 39
 		$ds = DIRECTORY_SEPARATOR;
40
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
40
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
41 41
 
42 42
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
43 43
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	public function testConstructImageException()
49 49
 	{
50 50
 		$ds = DIRECTORY_SEPARATOR;
51
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'application.txt' );
51
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'application.txt' );
52 52
 
53 53
 		$this->setExpectedException( '\\Aimeos\\MW\\Media\\Exception' );
54 54
 		new \Aimeos\MW\Media\Image\Standard( $content, 'text/plain', array() );
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	public function testDestruct()
59 59
 	{
60 60
 		$ds = DIRECTORY_SEPARATOR;
61
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
61
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
62 62
 
63 63
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
64 64
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 	public function testSaveGif()
70 70
 	{
71 71
 		$ds = DIRECTORY_SEPARATOR;
72
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
73
-		$dest = dirname( dirname( dirname( __DIR__ ) ) ) . $ds . 'tmp' . $ds . 'media.gif';
72
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
73
+		$dest = dirname( dirname( dirname( __DIR__ ) ) ).$ds.'tmp'.$ds.'media.gif';
74 74
 
75 75
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
76 76
 		$media->save( $dest, 'image/gif' );
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 	public function testSaveGifInvalidDest()
84 84
 	{
85 85
 		$ds = DIRECTORY_SEPARATOR;
86
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
87
-		$dest = __DIR__ . $ds . 'notexisting' . $ds . 'media.gif';
86
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
87
+		$dest = __DIR__.$ds.'notexisting'.$ds.'media.gif';
88 88
 
89 89
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
90 90
 
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
 	public function testSaveJpeg()
97 97
 	{
98 98
 		$ds = DIRECTORY_SEPARATOR;
99
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
100
-		$dest = dirname( dirname( dirname( __DIR__ ) ) ) . $ds . 'tmp' . $ds . 'media.jpg';
99
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
100
+		$dest = dirname( dirname( dirname( __DIR__ ) ) ).$ds.'tmp'.$ds.'media.jpg';
101 101
 
102 102
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/gif', array() );
103 103
 		$media->save( $dest, 'image/jpeg' );
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	public function testSaveJpegInvalidDest()
111 111
 	{
112 112
 		$ds = DIRECTORY_SEPARATOR;
113
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
114
-		$dest = __DIR__ . $ds . 'notexisting' . $ds . 'media.jpg';
113
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
114
+		$dest = __DIR__.$ds.'notexisting'.$ds.'media.jpg';
115 115
 
116 116
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
117 117
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 	public function testSavePng()
124 124
 	{
125 125
 		$ds = DIRECTORY_SEPARATOR;
126
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.gif' );
127
-		$dest = dirname( dirname( dirname( __DIR__ ) ) ) . $ds . 'tmp' . $ds . 'media.png';
126
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.gif' );
127
+		$dest = dirname( dirname( dirname( __DIR__ ) ) ).$ds.'tmp'.$ds.'media.png';
128 128
 
129 129
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/gif', array() );
130 130
 		$media->save( $dest, 'image/png' );
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 	public function testSavePngInvalidDest()
138 138
 	{
139 139
 		$ds = DIRECTORY_SEPARATOR;
140
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.gif' );
141
-		$dest = __DIR__ . $ds . 'notexisting' . $ds . 'media.png';
140
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.gif' );
141
+		$dest = __DIR__.$ds.'notexisting'.$ds.'media.png';
142 142
 
143 143
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/gif', array() );
144 144
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	public function testScale()
151 151
 	{
152 152
 		$ds = DIRECTORY_SEPARATOR;
153
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
153
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
154 154
 
155 155
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
156 156
 		$info = getimagesizefromstring( $media->scale( 100, 100, false )->save( null, 'image/png' ) );
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	public function testScaleFit()
164 164
 	{
165 165
 		$ds = DIRECTORY_SEPARATOR;
166
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
166
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
167 167
 
168 168
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
169 169
 		$info = getimagesizefromstring( $media->scale( 5, 100 )->save( null, 'image/png' ) );
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	public function testScaleFitInside()
177 177
 	{
178 178
 		$ds = DIRECTORY_SEPARATOR;
179
-		$content = file_get_contents( dirname( __DIR__ ) . $ds . '_testfiles' . $ds . 'image.png' );
179
+		$content = file_get_contents( dirname( __DIR__ ).$ds.'_testfiles'.$ds.'image.png' );
180 180
 
181 181
 		$media = new \Aimeos\MW\Media\Image\Standard( $content, 'image/png', array() );
182 182
 		$info = getimagesizefromstring( $media->scale( 100, 100 )->save( null, 'image/png' ) );
Please login to merge, or discard this patch.
lib/mwlib/tests/MW/Media/FactoryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	public function testGetImage()
16 16
 	{
17 17
 		$ds = DIRECTORY_SEPARATOR;
18
-		$object = \Aimeos\MW\Media\Factory::get( __DIR__ . $ds .'_testfiles' . $ds . 'image.png' );
18
+		$object = \Aimeos\MW\Media\Factory::get( __DIR__.$ds.'_testfiles'.$ds.'image.png' );
19 19
 
20 20
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Iface', $object );
21 21
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Image\\Iface', $object );
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	public function testGetBinary()
27 27
 	{
28 28
 		$ds = DIRECTORY_SEPARATOR;
29
-		$object = \Aimeos\MW\Media\Factory::get( __DIR__ . $ds . '_testfiles' . $ds . 'application.txt' );
29
+		$object = \Aimeos\MW\Media\Factory::get( __DIR__.$ds.'_testfiles'.$ds.'application.txt' );
30 30
 
31 31
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Iface', $object );
32 32
 		$this->assertInstanceOf( '\\Aimeos\\MW\\Media\\Application\\Iface', $object );
Please login to merge, or discard this patch.
lib/mwlib/src/MW/Media/Image/Standard.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 		parent::__construct( $mimetype );
42 42
 
43 43
 		if( ( $this->image = @imagecreatefromstring( $content ) ) === false ) {
44
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'The image type isn\'t supported by GDlib.') );
44
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'The image type isn\'t supported by GDlib.' ) );
45 45
 		}
46 46
 
47 47
 		if( ( $this->info = getimagesizefromstring( $content ) ) === false ) {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 
51 51
 		if( imagealphablending( $this->image, false ) === false ) {
52
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)') );
52
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)' ) );
53 53
 		}
54 54
 
55 55
 		$this->options = $options;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 					}
121 121
 
122 122
 					if( imagesavealpha( $this->image, true ) === false ) {
123
-						throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagesavealpha)') );
123
+						throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagesavealpha)' ) );
124 124
 					}
125 125
 
126 126
 					if( @imagepng( $this->image, $filename, $quality ) === false ) {
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
 		}
176 176
 
177 177
 		if( imagealphablending( $this->image, false ) === false ) {
178
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)') );
178
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagealphablending)' ) );
179 179
 		}
180 180
 
181 181
 		if( ( $transparent = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 ) ) === false ) {
182
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagecolorallocatealpha)') );
182
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagecolorallocatealpha)' ) );
183 183
 		}
184 184
 
185 185
 		if( imagefilledrectangle( $this->image, 0, 0, $width, $height, $transparent ) === false ) {
186
-			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagefilledrectangle)') );
186
+			throw new \Aimeos\MW\Media\Exception( sprintf( 'GD library failed (imagefilledrectangle)' ) );
187 187
 		}
188 188
 
189 189
 		if( imagecopyresampled( $this->image, $this->origimage, 0, 0, 0, 0, $width, $height, $this->info[0], $this->info[1] ) === false ) {
Please login to merge, or discard this patch.