24
24
use PHPCR \SimpleCredentials ;
25
25
use PHPCR \Util \NodeHelper ;
26
26
use PHPCR \Util \PathHelper ;
27
+ use PHPUnit \Framework \Assert ;
27
28
use Symfony \Component \Filesystem \Filesystem ;
28
29
29
30
/**
@@ -199,7 +200,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
199
200
}
200
201
}
201
202
202
- \PHPUnit_Framework_Assert ::assertGreaterThanOrEqual (count ($ expectedRows ), $ foundRows , $ this ->getOutput ());
203
+ Assert ::assertGreaterThanOrEqual (count ($ expectedRows ), $ foundRows , $ this ->getOutput ());
203
204
}
204
205
205
206
/**
@@ -208,7 +209,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
208
209
public function iShouldSeeTheFollowing (PyStringNode $ string )
209
210
{
210
211
$ output = $ this ->getOutput ();
211
- \PHPUnit_Framework_Assert ::assertContains ($ string ->getRaw (), $ output );
212
+ Assert ::assertContains ($ string ->getRaw (), $ output );
212
213
}
213
214
214
215
/**
@@ -217,7 +218,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string)
217
218
public function iShouldNotSeeTheFollowing (PyStringNode $ string )
218
219
{
219
220
$ output = $ this ->getOutput ();
220
- \PHPUnit_Framework_Assert ::assertNotContains ($ string ->getRaw (), $ output );
221
+ Assert ::assertNotContains ($ string ->getRaw (), $ output );
221
222
}
222
223
223
224
/**
@@ -248,7 +249,7 @@ public function theCommandShouldNotFail()
248
249
throw new \Exception ('Command failed: ( ' .$ exitCode .') ' .$ this ->getOutput ());
249
250
}
250
251
251
- \PHPUnit_Framework_Assert ::assertEquals (0 , $ exitCode , 'Command exited with code: ' .$ exitCode );
252
+ Assert ::assertEquals (0 , $ exitCode , 'Command exited with code: ' .$ exitCode );
252
253
}
253
254
254
255
/**
@@ -258,7 +259,7 @@ public function theCommandShouldFail()
258
259
{
259
260
$ exitCode = $ this ->applicationTester ->getLastExitCode ();
260
261
261
- \PHPUnit_Framework_Assert ::assertNotEquals (0 , $ exitCode , 'Command exited with code ' .$ exitCode );
262
+ Assert ::assertNotEquals (0 , $ exitCode , 'Command exited with code ' .$ exitCode );
262
263
}
263
264
264
265
/**
@@ -269,15 +270,15 @@ public function theCommandShouldFailWithMessage($arg1)
269
270
$ exitCode = $ this ->applicationTester ->getLastExitCode ();
270
271
$ output = $ this ->getOutput ();
271
272
272
- \PHPUnit_Framework_Assert ::assertEquals ($ arg1 , $ output );
273
+ Assert ::assertEquals ($ arg1 , $ output );
273
274
}
274
275
275
276
/**
276
277
* @Given /^the file "([^"]*)" should exist$/
277
278
*/
278
279
public function theFileShouldExist ($ arg1 )
279
280
{
280
- \PHPUnit_Framework_Assert ::assertTrue (file_exists ($ this ->getWorkingFilePath ($ arg1 )));
281
+ Assert ::assertTrue (file_exists ($ this ->getWorkingFilePath ($ arg1 )));
281
282
}
282
283
283
284
/**
@@ -304,7 +305,7 @@ public function theFileExists($arg1)
304
305
public function theOutputShouldContain (PyStringNode $ string )
305
306
{
306
307
foreach ($ string ->getStrings () as $ line ) {
307
- \PHPUnit_Framework_Assert ::assertContains ($ line , $ this ->getOutput ());
308
+ Assert ::assertContains ($ line , $ this ->getOutput ());
308
309
}
309
310
}
310
311
@@ -315,7 +316,7 @@ public function theNodeShouldNotExist($arg1)
315
316
{
316
317
$ session = $ this ->getSession ();
317
318
$ node = $ session ->getNode ($ arg1 );
318
- \PHPUnit_Framework_Assert ::assertNull ($ node );
319
+ Assert ::assertNull ($ node );
319
320
}
320
321
321
322
/**
@@ -326,7 +327,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3)
326
327
$ xpath = $ this ->getXPathForFile ($ arg3 );
327
328
$ res = $ xpath ->query ($ arg1 );
328
329
329
- \PHPUnit_Framework_Assert ::assertEquals ($ arg2 , $ res ->length );
330
+ Assert ::assertEquals ($ arg2 , $ res ->length );
330
331
}
331
332
332
333
/**
@@ -363,7 +364,7 @@ public function iShouldNotBeLoggedIntoTheSession()
363
364
{
364
365
$ this ->executeCommand ('session:info ' );
365
366
$ output = $ this ->getOutput ();
366
- \PHPUnit_Framework_Assert ::assertRegExp ('/live .*no/ ' , $ output );
367
+ Assert ::assertRegExp ('/live .*no/ ' , $ output );
367
368
}
368
369
369
370
/**
@@ -427,7 +428,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2)
427
428
throw new \Exception ('Could not find child node ' .$ arg1 );
428
429
}
429
430
430
- \PHPUnit_Framework_Assert ::assertEquals ($ arg2 , $ afterNode ->getPath ());
431
+ Assert ::assertEquals ($ arg2 , $ afterNode ->getPath ());
431
432
}
432
433
433
434
/**
@@ -530,7 +531,7 @@ public function thenIShouldBeLoggedInAs($arg1)
530
531
$ session = $ this ->getSession ();
531
532
$ userId = $ session ->getUserID ();
532
533
533
- \PHPUnit_Framework_Assert ::assertEquals ($ userId , $ arg1 );
534
+ Assert ::assertEquals ($ userId , $ arg1 );
534
535
}
535
536
536
537
/**
@@ -690,7 +691,7 @@ public function theCurrentNodeShouldBe($arg1)
690
691
{
691
692
$ this ->executeCommand ('shell:path:show ' );
692
693
$ cnp = $ this ->applicationTester ->getLastLine ();
693
- \PHPUnit_Framework_Assert ::assertEquals ($ arg1 , $ cnp , 'Current path is ' .$ arg1 );
694
+ Assert ::assertEquals ($ arg1 , $ cnp , 'Current path is ' .$ arg1 );
694
695
}
695
696
696
697
/**
@@ -728,7 +729,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2)
728
729
$ session = $ this ->getSession ();
729
730
$ node = $ session ->getNode ($ arg1 );
730
731
$ primaryTypeName = $ node ->getPrimaryNodeType ()->getName ();
731
- \PHPUnit_Framework_Assert ::assertEquals ($ arg2 , $ primaryTypeName , 'Node type of ' .$ arg1 .' is ' .$ arg2 );
732
+ Assert ::assertEquals ($ arg2 , $ primaryTypeName , 'Node type of ' .$ arg1 .' is ' .$ arg2 );
732
733
}
733
734
734
735
/**
@@ -745,7 +746,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3)
745
746
$ propertyValue = $ propertyValue ->getIdentifier ();
746
747
}
747
748
748
- \PHPUnit_Framework_Assert ::assertEquals ($ arg3 , $ propertyValue );
749
+ Assert ::assertEquals ($ arg3 , $ propertyValue );
749
750
}
750
751
751
752
/**
@@ -761,7 +762,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar
761
762
}
762
763
763
764
$ propertyType = $ property ->getValue ();
764
- \PHPUnit_Framework_Assert ::assertEquals ($ arg3 , $ propertyType [$ index ]);
765
+ Assert ::assertEquals ($ arg3 , $ propertyType [$ index ]);
765
766
}
766
767
767
768
/**
@@ -777,7 +778,7 @@ public function thePropertyShouldHaveType($arg1, $arg2)
777
778
));
778
779
}
779
780
780
- \PHPUnit_Framework_Assert ::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
781
+ Assert ::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
781
782
}
782
783
783
784
/**
@@ -793,8 +794,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3)
793
794
));
794
795
}
795
796
796
- \PHPUnit_Framework_Assert ::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
797
- \PHPUnit_Framework_Assert ::assertEquals ($ arg3 , $ property ->getValue ());
797
+ Assert ::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
798
+ Assert ::assertEquals ($ arg3 , $ property ->getValue ());
798
799
}
799
800
800
801
/**
@@ -864,7 +865,7 @@ public function theNodeShouldBeLocked($arg1)
864
865
$ lockManager = $ workspace ->getLockManager ();
865
866
$ isLocked = $ lockManager ->isLocked ($ arg1 );
866
867
867
- \PHPUnit_Framework_Assert ::assertTrue ($ isLocked );
868
+ Assert ::assertTrue ($ isLocked );
868
869
}
869
870
870
871
/**
@@ -877,7 +878,7 @@ public function theNodeShouldNotBeLocked($arg1)
877
878
$ lockManager = $ workspace ->getLockManager ();
878
879
$ isLocked = $ lockManager ->isLocked ($ arg1 );
879
880
880
- \PHPUnit_Framework_Assert ::assertFalse ($ isLocked );
881
+ Assert ::assertFalse ($ isLocked );
881
882
}
882
883
883
884
/**
0 commit comments