Skip to content

Commit 423605a

Browse files
committed
Moved contexts to main namespace£
1 parent 02b7734 commit 423605a

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

features/bootstrap/ContextBase.php renamed to src/PHPCR/Shell/Test/ContextBase.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once(__DIR__.'/../../vendor/autoload.php');
3+
namespace PHPCR\Shell\Test;
44

55
use Jackalope\RepositoryFactoryJackrabbit;
66
use PHPCR\SimpleCredentials;
@@ -122,7 +122,7 @@ private function getXPathForFile($filename)
122122

123123
private function getFixtureFilename($filename)
124124
{
125-
$fixtureFile = realpath(__DIR__).'/../fixtures/'.$filename;
125+
$fixtureFile = realpath(__DIR__).'/../../../../features/fixtures/'.$filename;
126126
if (!file_exists($fixtureFile)) {
127127
throw new \Exception('Fixtures do not exist at ' . $fixtureFile);
128128
}
@@ -194,7 +194,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
194194
}
195195
}
196196

197-
PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput());
197+
\PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput());
198198
}
199199

200200
/**
@@ -203,7 +203,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
203203
public function iShouldSeeTheFollowing(PyStringNode $string)
204204
{
205205
$output = $this->getOutput();
206-
PHPUnit_Framework_Assert::assertContains($string->getRaw(), $output);
206+
\PHPUnit_Framework_Assert::assertContains($string->getRaw(), $output);
207207
}
208208

209209
/**
@@ -212,7 +212,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string)
212212
public function iShouldNotSeeTheFollowing(PyStringNode $string)
213213
{
214214
$output = $this->getOutput();
215-
PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output);
215+
\PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output);
216216
}
217217

218218
/**
@@ -239,7 +239,7 @@ public function theCommandShouldNotFail()
239239
throw new \Exception('Command failed: (' . $exitCode . ') ' . $this->getOutput());
240240
}
241241

242-
PHPUnit_Framework_Assert::assertEquals(0, $exitCode, 'Command exited with code: ' . $exitCode);
242+
\PHPUnit_Framework_Assert::assertEquals(0, $exitCode, 'Command exited with code: ' . $exitCode);
243243
}
244244

245245
/**
@@ -249,7 +249,7 @@ public function theCommandShouldFail()
249249
{
250250
$exitCode = $this->applicationTester->getLastExitCode();
251251

252-
PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code ' . $exitCode);
252+
\PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code ' . $exitCode);
253253
}
254254

255255
/**
@@ -260,14 +260,14 @@ public function theCommandShouldFailWithMessage($arg1)
260260
$exitCode = $this->applicationTester->getLastExitCode();
261261
$output = $this->getOutput();
262262

263-
PHPUnit_Framework_Assert::assertEquals($arg1, $output);
263+
\PHPUnit_Framework_Assert::assertEquals($arg1, $output);
264264
}
265265
/**
266266
* @Given /^the file "([^"]*)" should exist$/
267267
*/
268268
public function theFileShouldExist($arg1)
269269
{
270-
PHPUnit_Framework_Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1)));
270+
\PHPUnit_Framework_Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1)));
271271
}
272272

273273
/**
@@ -294,7 +294,7 @@ public function theFileExists($arg1)
294294
public function theOutputShouldContain(PyStringNode $string)
295295
{
296296
foreach ($string->getLines() as $line) {
297-
PHPUnit_Framework_Assert::assertContains($line, $this->getOutput());
297+
\PHPUnit_Framework_Assert::assertContains($line, $this->getOutput());
298298
}
299299
}
300300

@@ -305,7 +305,7 @@ public function theNodeShouldNotExist($arg1)
305305
{
306306
$session = $this->getSession();
307307
$node = $session->getNode($arg1);
308-
PHPUnit_Framework_Assert::assertNull($node);
308+
\PHPUnit_Framework_Assert::assertNull($node);
309309
}
310310

311311
/**
@@ -316,7 +316,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3)
316316
$xpath = $this->getXPathForFile($arg3);
317317
$res = $xpath->query($arg1);
318318

319-
PHPUnit_Framework_Assert::assertEquals($arg2, $res->length);
319+
\PHPUnit_Framework_Assert::assertEquals($arg2, $res->length);
320320
}
321321

322322
/**
@@ -353,7 +353,7 @@ public function iShouldNotBeLoggedIntoTheSession()
353353
{
354354
$this->executeCommand('session:info');
355355
$output = $this->getOutput();
356-
PHPUnit_Framework_Assert::assertRegExp('/live .*no/', $output);
356+
\PHPUnit_Framework_Assert::assertRegExp('/live .*no/', $output);
357357
}
358358

359359
/**
@@ -416,7 +416,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2)
416416
throw new \Exception('Could not find child node ' . $arg1);
417417
}
418418

419-
PHPUnit_Framework_Assert::assertEquals($arg2, $afterNode->getPath());
419+
\PHPUnit_Framework_Assert::assertEquals($arg2, $afterNode->getPath());
420420
}
421421

422422
/**
@@ -517,7 +517,7 @@ public function thenIShouldBeLoggedInAs($arg1)
517517
$session = $this->getSession();
518518
$userId = $session->getUserID();
519519

520-
PHPUnit_Framework_Assert::assertEquals($userId, $arg1);
520+
\PHPUnit_Framework_Assert::assertEquals($userId, $arg1);
521521
}
522522

523523
/**
@@ -673,7 +673,7 @@ public function theCurrentNodeShouldBe($arg1)
673673
{
674674
$this->executeCommand('shell:path:show');
675675
$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);
677677
}
678678

679679
/**
@@ -711,7 +711,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2)
711711
$session = $this->getSession();
712712
$node = $session->getNode($arg1);
713713
$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);
715715
}
716716

717717
/**
@@ -723,7 +723,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3)
723723
$node = $session->getNode($arg1);
724724
$property = $node->getProperty($arg2);
725725
$propertyType = $property->getValue();
726-
PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType);
726+
\PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType);
727727
}
728728

729729
/**
@@ -739,7 +739,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar
739739
}
740740

741741
$propertyType = $property->getValue();
742-
PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType[$index]);
742+
\PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType[$index]);
743743
}
744744

745745
/**
@@ -755,7 +755,7 @@ public function thePropertyShouldHaveType($arg1, $arg2)
755755
));
756756
}
757757

758-
PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType()));
758+
\PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType()));
759759
}
760760

761761

@@ -772,8 +772,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3)
772772
));
773773
}
774774

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());
777777
}
778778

779779
/**
@@ -843,7 +843,7 @@ public function theNodeShouldBeLocked($arg1)
843843
$lockManager = $workspace->getLockManager();
844844
$isLocked = $lockManager->isLocked($arg1);
845845

846-
PHPUnit_Framework_Assert::assertTrue($isLocked);
846+
\PHPUnit_Framework_Assert::assertTrue($isLocked);
847847
}
848848

849849
/**
@@ -856,7 +856,7 @@ public function theNodeShouldNotBeLocked($arg1)
856856
$lockManager = $workspace->getLockManager();
857857
$isLocked = $lockManager->isLocked($arg1);
858858

859-
PHPUnit_Framework_Assert::assertFalse($isLocked);
859+
\PHPUnit_Framework_Assert::assertFalse($isLocked);
860860
}
861861

862862
/**

features/bootstrap/EmbeddedContext.php renamed to src/PHPCR/Shell/Test/EmbeddedContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once(__DIR__.'/../../vendor/autoload.php');
3+
namespace PHPCR\Shell\Test;
44

55
use PHPCR\Shell\Console\Application\EmbeddedApplication;
66
use PHPCR\Shell\Test\ApplicationTester;

features/bootstrap/StandaloneContext.php renamed to src/PHPCR/Shell/Test/StandaloneContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once(__DIR__.'/../../vendor/autoload.php');
3+
namespace PHPCR\Shell\Test;
44

55
use PHPCR\Shell\Console\Application\SessionApplication;
66
use PHPCR\Shell\Test\ApplicationTester;

0 commit comments

Comments
 (0)