@@ -26,122 +26,122 @@ class GImageTest extends \PHPUnit_Framework_TestCase
2626 public function testLoad ()
2727 {
2828 // Loading an image (200x200) from Gravatar
29- $ img = new Image ();
29+ $ img = new Image ();
3030 $ resource = $ img ->load ('http://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=200.jpg ' );
3131
3232 $ this ->assertNotNull ($ resource );
3333
3434 return $ img ;
3535 }
3636
37- /**
38- * @depends testLoad
39- */
40- public function testGetResource (Image $ img )
41- {
42- $ this ->assertNotEmpty ($ img ->getResource ());
43- $ this ->assertNotNull ($ img ->getResource ());
44-
45- return $ img ;
46- }
47-
48- /**
49- * @depends testGetResource
50- */
51- public function testIsJPG (Image $ img )
52- {
53- $ this ->assertTrue ($ img ->isJPG ());
54- }
55-
56- /**
57- * @depends testGetResource
58- */
59- public function testIsNotPNG (Image $ img )
60- {
61- $ this ->assertFalse ($ img ->isPNG ());
62- }
63-
64- /**
65- * @depends testGetResource
66- */
67- public function testIsNotGif (Image $ img )
68- {
69- $ this ->assertFalse ($ img ->isGIF ());
70- }
71-
72- /**
73- * @depends testGetResource
74- */
75- public function testIsLocal (Image $ img )
76- {
77- $ this ->assertFalse ($ img ->isLocal ());
78- }
79-
80- /**
81- * @depends testGetResource
82- */
83- public function testIsExternal (Image $ img )
84- {
85- $ this ->assertTrue ($ img ->isExternal ());
86- }
87-
88- /**
89- * @depends testLoad
90- */
91- public function testScale (Image $ img )
92- {
93- // Scaling to 50% (100x100)
94- $ img ->scale (50 );
95-
96- return $ img ;
97- }
98-
99- /**
100- * @depends testLoad
101- */
102- public function testCenterCrop (Image $ img )
103- {
104- // Center and croping to 100px
105- $ img ->centerCrop (100 , 100 );
106-
107- return $ img ;
108- }
109-
110- /**
111- * @depends testLoad
112- */
113- public function testRotate (Image $ img )
114- {
115- // Rotating to 180º
116- $ img ->rotate (180 );
117-
118- return $ img ;
119- }
37+ /**
38+ * @depends testLoad
39+ */
40+ public function testGetResource (Image $ img )
41+ {
42+ $ this ->assertNotEmpty ($ img ->getResource ());
43+ $ this ->assertNotNull ($ img ->getResource ());
44+
45+ return $ img ;
46+ }
47+
48+ /**
49+ * @depends testGetResource
50+ */
51+ public function testIsJPG (Image $ img )
52+ {
53+ $ this ->assertTrue ($ img ->isJPG ());
54+ }
55+
56+ /**
57+ * @depends testGetResource
58+ */
59+ public function testIsNotPNG (Image $ img )
60+ {
61+ $ this ->assertFalse ($ img ->isPNG ());
62+ }
63+
64+ /**
65+ * @depends testGetResource
66+ */
67+ public function testIsNotGif (Image $ img )
68+ {
69+ $ this ->assertFalse ($ img ->isGIF ());
70+ }
71+
72+ /**
73+ * @depends testGetResource
74+ */
75+ public function testIsLocal (Image $ img )
76+ {
77+ $ this ->assertFalse ($ img ->isLocal ());
78+ }
79+
80+ /**
81+ * @depends testGetResource
82+ */
83+ public function testIsExternal (Image $ img )
84+ {
85+ $ this ->assertTrue ($ img ->isExternal ());
86+ }
87+
88+ /**
89+ * @depends testLoad
90+ */
91+ public function testScale (Image $ img )
92+ {
93+ // Scaling to 50% (100x100)
94+ $ img ->scale (50 );
95+
96+ return $ img ;
97+ }
98+
99+ /**
100+ * @depends testLoad
101+ */
102+ public function testCenterCrop (Image $ img )
103+ {
104+ // Center and croping to 100px
105+ $ img ->centerCrop (100 , 100 );
106+
107+ return $ img ;
108+ }
109+
110+ /**
111+ * @depends testLoad
112+ */
113+ public function testRotate (Image $ img )
114+ {
115+ // Rotating to 180º
116+ $ img ->rotate (180 );
117+
118+ return $ img ;
119+ }
120120
121121 public function testCreateFigure ()
122122 {
123123 $ figure = new Figure (400 , 250 );
124124 $ figure
125- ->setBackgroundColor (47 , 42 , 39 )
126- ->create ();
125+ ->setBackgroundColor (47 , 42 , 39 )
126+ ->create ();
127127
128128 $ this ->assertInstanceOf ('GImage\Figure ' , $ figure );
129129
130130 return $ figure ;
131131 }
132132
133- /**
134- * @depends testCreateFigure
135- */
136- public function testCreateCanvas (Figure $ figure )
137- {
138- $ canvas = new Canvas ();
139- $ canvas ->from ($ figure );
133+ /**
134+ * @depends testCreateFigure
135+ */
136+ public function testCreateCanvas (Figure $ figure )
137+ {
138+ $ canvas = new Canvas ();
139+ $ canvas ->from ($ figure );
140140
141- $ this ->assertInstanceOf ('GImage\Image ' , $ canvas );
141+ $ this ->assertInstanceOf ('GImage\Image ' , $ canvas );
142142
143- return $ canvas ;
144- }
143+ return $ canvas ;
144+ }
145145
146146 public function testCreateText ()
147147 {
@@ -161,82 +161,82 @@ public function testCreateText()
161161 return $ text ;
162162 }
163163
164- /**
165- * @depends testCreateCanvas
166- * @depends testCreateText
167- */
168- public function testCanvasAppendText (Canvas $ canvas , Text $ text )
169- {
170- $ canvas
164+ /**
165+ * @depends testCreateCanvas
166+ * @depends testCreateText
167+ */
168+ public function testCanvasAppendText (Canvas $ canvas , Text $ text )
169+ {
170+ $ canvas
171171 ->append ($ text )
172172 ->toJPG ()
173173 ->draw ();
174174
175- $ this ->assertEquals ($ canvas ->getType (), IMAGETYPE_JPEG );
176-
177- return $ canvas ;
178- }
179-
180- /**
181- * @depends testScale
182- */
183- public function testPreserveResource (Image $ img )
184- {
185- $ img ->preserve ();
186- $ this ->assertNotNull ($ img ->getResource ());
187-
188- return $ img ;
189- }
190-
191- /**
192- * @depends testPreserveResource
193- */
194- public function testSavePreserved (Image $ img )
195- {
196- $ this ->assertNotNull ($ img ->save (GIMAGE_PATH_TMP . DS . 'test1.jpg ' ));
197- $ this ->assertNotNull ($ img ->getResource ());
198-
199- return $ img ;
200- }
201-
202- /**
203- * @depends testScale
204- */
205- public function testNotPreserveResource (Image $ img )
206- {
207- $ img ->preserve (false );
208-
209- $ this ->assertNotNull ($ img ->getResource ());
210-
211- return $ img ;
212- }
213-
214- /**
215- * @depends testNotPreserveResource
216- */
217- public function testSaveNotPreserved (Image $ img )
218- {
219- $ this ->assertNotNull ($ img ->save (GIMAGE_PATH_TMP . DS . 'test2.jpg ' ));
220- $ this ->assertNull ($ img ->getResource ());
221-
222- return $ img ;
223- }
224-
225- /**
226- * @depends testLoad
227- */
228- public function testDestroyResource (Image $ img )
229- {
230- $ img ->destroy ();
231-
232- $ this ->assertNull ($ img ->getResource ());
233- }
234-
235- /**
236- * @depends testCanvasAppendText
237- */
238- public function testCanvasSave (Canvas $ canvas )
239- {
240- $ this ->assertNotNull ($ canvas ->save (GIMAGE_PATH_TMP . DS . 'test3.jpg ' ));
241- }
175+ $ this ->assertEquals ($ canvas ->getType (), IMAGETYPE_JPEG );
176+
177+ return $ canvas ;
178+ }
179+
180+ /**
181+ * @depends testScale
182+ */
183+ public function testPreserveResource (Image $ img )
184+ {
185+ $ img ->preserve ();
186+ $ this ->assertNotNull ($ img ->getResource ());
187+
188+ return $ img ;
189+ }
190+
191+ /**
192+ * @depends testPreserveResource
193+ */
194+ public function testSavePreserved (Image $ img )
195+ {
196+ $ this ->assertNotNull ($ img ->save (GIMAGE_PATH_TMP . DS . 'test1.jpg ' ));
197+ $ this ->assertNotNull ($ img ->getResource ());
198+
199+ return $ img ;
200+ }
201+
202+ /**
203+ * @depends testScale
204+ */
205+ public function testNotPreserveResource (Image $ img )
206+ {
207+ $ img ->preserve (false );
208+
209+ $ this ->assertNotNull ($ img ->getResource ());
210+
211+ return $ img ;
212+ }
213+
214+ /**
215+ * @depends testNotPreserveResource
216+ */
217+ public function testSaveNotPreserved (Image $ img )
218+ {
219+ $ this ->assertNotNull ($ img ->save (GIMAGE_PATH_TMP . DS . 'test2.jpg ' ));
220+ $ this ->assertNull ($ img ->getResource ());
221+
222+ return $ img ;
223+ }
224+
225+ /**
226+ * @depends testLoad
227+ */
228+ public function testDestroyResource (Image $ img )
229+ {
230+ $ img ->destroy ();
231+
232+ $ this ->assertNull ($ img ->getResource ());
233+ }
234+
235+ /**
236+ * @depends testCanvasAppendText
237+ */
238+ public function testCanvasSave (Canvas $ canvas )
239+ {
240+ $ this ->assertNotNull ($ canvas ->save (GIMAGE_PATH_TMP . DS . 'test3.jpg ' ));
241+ }
242242}
0 commit comments