1
1
<?php
2
2
3
- require_once ( __DIR__ . ' /../../vendor/autoload.php ' ) ;
3
+ namespace PHPCR \ Shell \ Test ;
4
4
5
5
use Jackalope \RepositoryFactoryJackrabbit ;
6
6
use PHPCR \SimpleCredentials ;
@@ -122,7 +122,7 @@ private function getXPathForFile($filename)
122
122
123
123
private function getFixtureFilename ($ filename )
124
124
{
125
- $ fixtureFile = realpath (__DIR__ ).'/../fixtures/ ' .$ filename ;
125
+ $ fixtureFile = realpath (__DIR__ ).'/../../../../features/ fixtures/ ' .$ filename ;
126
126
if (!file_exists ($ fixtureFile )) {
127
127
throw new \Exception ('Fixtures do not exist at ' . $ fixtureFile );
128
128
}
@@ -194,7 +194,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
194
194
}
195
195
}
196
196
197
- PHPUnit_Framework_Assert::assertGreaterThanOrEqual (count ($ expectedRows ), $ foundRows , $ this ->getOutput ());
197
+ \ PHPUnit_Framework_Assert::assertGreaterThanOrEqual (count ($ expectedRows ), $ foundRows , $ this ->getOutput ());
198
198
}
199
199
200
200
/**
@@ -203,7 +203,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
203
203
public function iShouldSeeTheFollowing (PyStringNode $ string )
204
204
{
205
205
$ output = $ this ->getOutput ();
206
- PHPUnit_Framework_Assert::assertContains ($ string ->getRaw (), $ output );
206
+ \ PHPUnit_Framework_Assert::assertContains ($ string ->getRaw (), $ output );
207
207
}
208
208
209
209
/**
@@ -212,7 +212,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string)
212
212
public function iShouldNotSeeTheFollowing (PyStringNode $ string )
213
213
{
214
214
$ output = $ this ->getOutput ();
215
- PHPUnit_Framework_Assert::assertNotContains ($ string ->getRaw (), $ output );
215
+ \ PHPUnit_Framework_Assert::assertNotContains ($ string ->getRaw (), $ output );
216
216
}
217
217
218
218
/**
@@ -239,7 +239,7 @@ public function theCommandShouldNotFail()
239
239
throw new \Exception ('Command failed: ( ' . $ exitCode . ') ' . $ this ->getOutput ());
240
240
}
241
241
242
- PHPUnit_Framework_Assert::assertEquals (0 , $ exitCode , 'Command exited with code: ' . $ exitCode );
242
+ \ PHPUnit_Framework_Assert::assertEquals (0 , $ exitCode , 'Command exited with code: ' . $ exitCode );
243
243
}
244
244
245
245
/**
@@ -249,7 +249,7 @@ public function theCommandShouldFail()
249
249
{
250
250
$ exitCode = $ this ->applicationTester ->getLastExitCode ();
251
251
252
- PHPUnit_Framework_Assert::assertNotEquals (0 , $ exitCode , 'Command exited with code ' . $ exitCode );
252
+ \ PHPUnit_Framework_Assert::assertNotEquals (0 , $ exitCode , 'Command exited with code ' . $ exitCode );
253
253
}
254
254
255
255
/**
@@ -260,14 +260,14 @@ public function theCommandShouldFailWithMessage($arg1)
260
260
$ exitCode = $ this ->applicationTester ->getLastExitCode ();
261
261
$ output = $ this ->getOutput ();
262
262
263
- PHPUnit_Framework_Assert::assertEquals ($ arg1 , $ output );
263
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg1 , $ output );
264
264
}
265
265
/**
266
266
* @Given /^the file "([^"]*)" should exist$/
267
267
*/
268
268
public function theFileShouldExist ($ arg1 )
269
269
{
270
- PHPUnit_Framework_Assert::assertTrue (file_exists ($ this ->getWorkingFilePath ($ arg1 )));
270
+ \ PHPUnit_Framework_Assert::assertTrue (file_exists ($ this ->getWorkingFilePath ($ arg1 )));
271
271
}
272
272
273
273
/**
@@ -294,7 +294,7 @@ public function theFileExists($arg1)
294
294
public function theOutputShouldContain (PyStringNode $ string )
295
295
{
296
296
foreach ($ string ->getLines () as $ line ) {
297
- PHPUnit_Framework_Assert::assertContains ($ line , $ this ->getOutput ());
297
+ \ PHPUnit_Framework_Assert::assertContains ($ line , $ this ->getOutput ());
298
298
}
299
299
}
300
300
@@ -305,7 +305,7 @@ public function theNodeShouldNotExist($arg1)
305
305
{
306
306
$ session = $ this ->getSession ();
307
307
$ node = $ session ->getNode ($ arg1 );
308
- PHPUnit_Framework_Assert::assertNull ($ node );
308
+ \ PHPUnit_Framework_Assert::assertNull ($ node );
309
309
}
310
310
311
311
/**
@@ -316,7 +316,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3)
316
316
$ xpath = $ this ->getXPathForFile ($ arg3 );
317
317
$ res = $ xpath ->query ($ arg1 );
318
318
319
- PHPUnit_Framework_Assert::assertEquals ($ arg2 , $ res ->length );
319
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg2 , $ res ->length );
320
320
}
321
321
322
322
/**
@@ -353,7 +353,7 @@ public function iShouldNotBeLoggedIntoTheSession()
353
353
{
354
354
$ this ->executeCommand ('session:info ' );
355
355
$ output = $ this ->getOutput ();
356
- PHPUnit_Framework_Assert::assertRegExp ('/live .*no/ ' , $ output );
356
+ \ PHPUnit_Framework_Assert::assertRegExp ('/live .*no/ ' , $ output );
357
357
}
358
358
359
359
/**
@@ -416,7 +416,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2)
416
416
throw new \Exception ('Could not find child node ' . $ arg1 );
417
417
}
418
418
419
- PHPUnit_Framework_Assert::assertEquals ($ arg2 , $ afterNode ->getPath ());
419
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg2 , $ afterNode ->getPath ());
420
420
}
421
421
422
422
/**
@@ -517,7 +517,7 @@ public function thenIShouldBeLoggedInAs($arg1)
517
517
$ session = $ this ->getSession ();
518
518
$ userId = $ session ->getUserID ();
519
519
520
- PHPUnit_Framework_Assert::assertEquals ($ userId , $ arg1 );
520
+ \ PHPUnit_Framework_Assert::assertEquals ($ userId , $ arg1 );
521
521
}
522
522
523
523
/**
@@ -673,7 +673,7 @@ public function theCurrentNodeShouldBe($arg1)
673
673
{
674
674
$ this ->executeCommand ('shell:path:show ' );
675
675
$ cnp = $ this ->applicationTester ->getLastLine ();
676
- PHPUnit_Framework_Assert::assertEquals ($ arg1 , $ cnp , 'Current path is ' . $ arg1 );
676
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg1 , $ cnp , 'Current path is ' . $ arg1 );
677
677
}
678
678
679
679
/**
@@ -711,7 +711,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2)
711
711
$ session = $ this ->getSession ();
712
712
$ node = $ session ->getNode ($ arg1 );
713
713
$ primaryTypeName = $ node ->getPrimaryNodeType ()->getName ();
714
- PHPUnit_Framework_Assert::assertEquals ($ arg2 , $ primaryTypeName , 'Node type of ' . $ arg1 . ' is ' . $ arg2 );
714
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg2 , $ primaryTypeName , 'Node type of ' . $ arg1 . ' is ' . $ arg2 );
715
715
}
716
716
717
717
/**
@@ -723,7 +723,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3)
723
723
$ node = $ session ->getNode ($ arg1 );
724
724
$ property = $ node ->getProperty ($ arg2 );
725
725
$ propertyType = $ property ->getValue ();
726
- PHPUnit_Framework_Assert::assertEquals ($ arg3 , $ propertyType );
726
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg3 , $ propertyType );
727
727
}
728
728
729
729
/**
@@ -739,7 +739,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar
739
739
}
740
740
741
741
$ propertyType = $ property ->getValue ();
742
- PHPUnit_Framework_Assert::assertEquals ($ arg3 , $ propertyType [$ index ]);
742
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg3 , $ propertyType [$ index ]);
743
743
}
744
744
745
745
/**
@@ -755,7 +755,7 @@ public function thePropertyShouldHaveType($arg1, $arg2)
755
755
));
756
756
}
757
757
758
- PHPUnit_Framework_Assert::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
758
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
759
759
}
760
760
761
761
@@ -772,8 +772,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3)
772
772
));
773
773
}
774
774
775
- PHPUnit_Framework_Assert::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
776
- PHPUnit_Framework_Assert::assertEquals ($ arg3 , $ property ->getValue ());
775
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg2 , PropertyType::nameFromValue ($ property ->getType ()));
776
+ \ PHPUnit_Framework_Assert::assertEquals ($ arg3 , $ property ->getValue ());
777
777
}
778
778
779
779
/**
@@ -843,7 +843,7 @@ public function theNodeShouldBeLocked($arg1)
843
843
$ lockManager = $ workspace ->getLockManager ();
844
844
$ isLocked = $ lockManager ->isLocked ($ arg1 );
845
845
846
- PHPUnit_Framework_Assert::assertTrue ($ isLocked );
846
+ \ PHPUnit_Framework_Assert::assertTrue ($ isLocked );
847
847
}
848
848
849
849
/**
@@ -856,7 +856,7 @@ public function theNodeShouldNotBeLocked($arg1)
856
856
$ lockManager = $ workspace ->getLockManager ();
857
857
$ isLocked = $ lockManager ->isLocked ($ arg1 );
858
858
859
- PHPUnit_Framework_Assert::assertFalse ($ isLocked );
859
+ \ PHPUnit_Framework_Assert::assertFalse ($ isLocked );
860
860
}
861
861
862
862
/**
0 commit comments