@@ -147,21 +147,21 @@ public function testLoadUpperCase()
147147 public function testLoadWithFile ()
148148 {
149149 $ dom = new Dom ;
150- $ dom ->loadFromFile (' tests /files/small.html ' );
150+ $ dom ->loadFromFile (__DIR__ . ' /files/small.html ' );
151151 $ this ->assertEquals ('VonBurgermeister ' , $ dom ->find ('.post-user font ' , 0 )->text );
152152 }
153153
154154 public function testLoadFromFile ()
155155 {
156156 $ dom = new Dom ;
157- $ dom ->loadFromFile (' tests /files/small.html ' );
157+ $ dom ->loadFromFile (__DIR__ . ' /files/small.html ' );
158158 $ this ->assertEquals ('VonBurgermeister ' , $ dom ->find ('.post-user font ' , 0 )->text );
159159 }
160160
161161 public function testLoadFromFileFind ()
162162 {
163163 $ dom = new Dom ;
164- $ dom ->loadFromFile (' tests /files/small.html ' );
164+ $ dom ->loadFromFile (__DIR__ . ' /files/small.html ' );
165165 $ this ->assertEquals ('VonBurgermeister ' , $ dom ->find ('.post-row div .post-user font ' , 0 )->text );
166166 }
167167
@@ -175,22 +175,22 @@ public function testLoadUtf8()
175175 public function testLoadFileBig ()
176176 {
177177 $ dom = new Dom ;
178- $ dom ->loadFromFile (' tests /files/big.html ' );
178+ $ dom ->loadFromFile (__DIR__ . ' /files/big.html ' );
179179 $ this ->assertEquals (10 , count ($ dom ->find ('.content-border ' )));
180180 }
181181
182182 public function testLoadFileBigTwice ()
183183 {
184184 $ dom = new Dom ;
185- $ dom ->loadFromFile (' tests /files/big.html ' );
185+ $ dom ->loadFromFile (__DIR__ . ' /files/big.html ' );
186186 $ post = $ dom ->find ('.post-row ' , 0 );
187187 $ this ->assertEquals (' <p>Журчанье воды<br /> Черно-белые тени<br /> Вновь на фонтане</p> ' , $ post ->find ('.post-message ' , 0 )->innerHtml );
188188 }
189189
190190 public function testLoadFileBigTwicePreserveOption ()
191191 {
192192 $ dom = new Dom ;
193- $ dom ->loadFromFile (' tests /files/big.html ' , ['preserveLineBreaks ' => true ]);
193+ $ dom ->loadFromFile (__DIR__ . ' /files/big.html ' , ['preserveLineBreaks ' => true ]);
194194 $ post = $ dom ->find ('.post-row ' , 0 );
195195 $ this ->assertEquals ('<p>Журчанье воды<br />
196196Черно-белые тени<br />
@@ -203,7 +203,7 @@ public function testLoadFromUrl()
203203 $ curl ->shouldReceive ('get ' )
204204 ->once ()
205205 ->with ('http://google.com ' )
206- ->andReturn (file_get_contents (' tests /files/small.html ' ));
206+ ->andReturn (file_get_contents (__DIR__ . ' /files/small.html ' ));
207207
208208 $ dom = new Dom ;
209209 $ dom ->loadFromUrl ('http://google.com ' , [], $ curl );
@@ -262,7 +262,7 @@ public function testGetElementsByClass()
262262 public function testEnforceEncoding ()
263263 {
264264 $ dom = new Dom ;
265- $ dom ->load (' tests /files/horrible.html ' , [
265+ $ dom ->load (__DIR__ . ' /files/horrible.html ' , [
266266 'enforceEncoding ' => 'UTF-8 ' ,
267267 ]);
268268 $ this ->assertNotEquals ('<input type="submit" tabindex="0" name="submit" value="Информации" /> ' , $ dom ->find ('table input ' , 1 )->outerHtml );
0 commit comments