Skip to content

Commit 508ff70

Browse files
Revert "Use webmozart assert in behat tests"
This reverts commit 54cc4d5. Conflicts: composer.json
1 parent f757be4 commit 508ff70

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"behat/behat": "^3.1",
2121
"phpspec/phpspec": "^6.0",
2222
"jackalope/jackalope-doctrine-dbal": "^1.2",
23-
"jackalope/jackalope-jackrabbit": "^1.2",
24-
"webmozart/assert": "^1.6"
23+
"jackalope/jackalope-jackrabbit": "^1.2"
2524
},
2625
"suggest": {
2726
"jackalope/jackalope-doctrine-dbal": "To connect to jackalope doctrine-dbal",

src/PHPCR/Shell/Test/CliContext.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Behat\Behat\Context\SnippetAcceptingContext;
1717
use Behat\Gherkin\Node\PyStringNode;
1818
use Symfony\Component\Filesystem\Filesystem;
19-
use Webmozart\Assert\Assert;
2019

2120
/**
2221
* Features context.
@@ -113,6 +112,6 @@ public function initializeDoctrineDbal()
113112
*/
114113
public function theCommandShouldNotFail()
115114
{
116-
Assert::eq(0, $this->lastExitCode);
115+
\PHPUnit_Framework_Assert::assertEquals(0, $this->lastExitCode);
117116
}
118117
}

src/PHPCR/Shell/Test/ContextBase.php

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use PHPCR\Util\NodeHelper;
2626
use PHPCR\Util\PathHelper;
2727
use Symfony\Component\Filesystem\Filesystem;
28-
use Webmozart\Assert\Assert;
2928

3029
/**
3130
* Features context.
@@ -200,7 +199,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
200199
}
201200
}
202201

203-
Assert::greaterThanEq(count($expectedRows), $foundRows, $this->getOutput());
202+
\PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput());
204203
}
205204

206205
/**
@@ -209,7 +208,7 @@ public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
209208
public function iShouldSeeTheFollowing(PyStringNode $string)
210209
{
211210
$output = $this->getOutput();
212-
Assert::contains($string->getRaw(), $output);
211+
\PHPUnit_Framework_Assert::assertContains($string->getRaw(), $output);
213212
}
214213

215214
/**
@@ -218,7 +217,7 @@ public function iShouldSeeTheFollowing(PyStringNode $string)
218217
public function iShouldNotSeeTheFollowing(PyStringNode $string)
219218
{
220219
$output = $this->getOutput();
221-
Assert::notContains($string->getRaw(), $output);
220+
\PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output);
222221
}
223222

224223
/**
@@ -249,7 +248,7 @@ public function theCommandShouldNotFail()
249248
throw new \Exception('Command failed: ('.$exitCode.') '.$this->getOutput());
250249
}
251250

252-
Assert::eq(0, $exitCode, 'Command exited with code: '.$exitCode);
251+
\PHPUnit_Framework_Assert::assertEquals(0, $exitCode, 'Command exited with code: '.$exitCode);
253252
}
254253

255254
/**
@@ -259,7 +258,7 @@ public function theCommandShouldFail()
259258
{
260259
$exitCode = $this->applicationTester->getLastExitCode();
261260

262-
Assert::notEq(0, $exitCode, 'Command exited with code '.$exitCode);
261+
\PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code '.$exitCode);
263262
}
264263

265264
/**
@@ -270,15 +269,15 @@ public function theCommandShouldFailWithMessage($arg1)
270269
$exitCode = $this->applicationTester->getLastExitCode();
271270
$output = $this->getOutput();
272271

273-
Assert::eq($arg1, $output);
272+
\PHPUnit_Framework_Assert::assertEquals($arg1, $output);
274273
}
275274

276275
/**
277276
* @Given /^the file "([^"]*)" should exist$/
278277
*/
279278
public function theFileShouldExist($arg1)
280279
{
281-
Assert::true(file_exists($this->getWorkingFilePath($arg1)));
280+
\PHPUnit_Framework_Assert::assertTrue(file_exists($this->getWorkingFilePath($arg1)));
282281
}
283282

284283
/**
@@ -305,7 +304,7 @@ public function theFileExists($arg1)
305304
public function theOutputShouldContain(PyStringNode $string)
306305
{
307306
foreach ($string->getStrings() as $line) {
308-
Assert::contains($line, $this->getOutput());
307+
\PHPUnit_Framework_Assert::assertContains($line, $this->getOutput());
309308
}
310309
}
311310

@@ -316,7 +315,7 @@ public function theNodeShouldNotExist($arg1)
316315
{
317316
$session = $this->getSession();
318317
$node = $session->getNode($arg1);
319-
Assert::null($node);
318+
\PHPUnit_Framework_Assert::assertNull($node);
320319
}
321320

322321
/**
@@ -327,7 +326,7 @@ public function theXpathCountIsInFile($arg1, $arg2, $arg3)
327326
$xpath = $this->getXPathForFile($arg3);
328327
$res = $xpath->query($arg1);
329328

330-
Assert::eq($arg2, $res->length);
329+
\PHPUnit_Framework_Assert::assertEquals($arg2, $res->length);
331330
}
332331

333332
/**
@@ -364,7 +363,7 @@ public function iShouldNotBeLoggedIntoTheSession()
364363
{
365364
$this->executeCommand('session:info');
366365
$output = $this->getOutput();
367-
Assert::regex('/live .*no/', $output);
366+
\PHPUnit_Framework_Assert::assertRegExp('/live .*no/', $output);
368367
}
369368

370369
/**
@@ -428,7 +427,7 @@ public function thereShouldExistANodeAtBefore($arg1, $arg2)
428427
throw new \Exception('Could not find child node '.$arg1);
429428
}
430429

431-
Assert::eq($arg2, $afterNode->getPath());
430+
\PHPUnit_Framework_Assert::assertEquals($arg2, $afterNode->getPath());
432431
}
433432

434433
/**
@@ -531,7 +530,7 @@ public function thenIShouldBeLoggedInAs($arg1)
531530
$session = $this->getSession();
532531
$userId = $session->getUserID();
533532

534-
Assert::eq($userId, $arg1);
533+
\PHPUnit_Framework_Assert::assertEquals($userId, $arg1);
535534
}
536535

537536
/**
@@ -691,7 +690,7 @@ public function theCurrentNodeShouldBe($arg1)
691690
{
692691
$this->executeCommand('shell:path:show');
693692
$cnp = $this->applicationTester->getLastLine();
694-
Assert::eq($arg1, $cnp, 'Current path is '.$arg1);
693+
\PHPUnit_Framework_Assert::assertEquals($arg1, $cnp, 'Current path is '.$arg1);
695694
}
696695

697696
/**
@@ -729,7 +728,7 @@ public function thePrimaryTypeOfShouldBe($arg1, $arg2)
729728
$session = $this->getSession();
730729
$node = $session->getNode($arg1);
731730
$primaryTypeName = $node->getPrimaryNodeType()->getName();
732-
Assert::eq($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2);
731+
\PHPUnit_Framework_Assert::assertEquals($arg2, $primaryTypeName, 'Node type of '.$arg1.' is '.$arg2);
733732
}
734733

735734
/**
@@ -746,7 +745,7 @@ public function theNodeAtShouldHaveThePropertyWithValue($arg1, $arg2, $arg3)
746745
$propertyValue = $propertyValue->getIdentifier();
747746
}
748747

749-
Assert::eq($arg3, $propertyValue);
748+
\PHPUnit_Framework_Assert::assertEquals($arg3, $propertyValue);
750749
}
751750

752751
/**
@@ -762,7 +761,7 @@ public function theNodeAtShouldHaveThePropertyWithValueAtIndex($arg1, $arg2, $ar
762761
}
763762

764763
$propertyType = $property->getValue();
765-
Assert::eq($arg3, $propertyType[$index]);
764+
\PHPUnit_Framework_Assert::assertEquals($arg3, $propertyType[$index]);
766765
}
767766

768767
/**
@@ -778,7 +777,7 @@ public function thePropertyShouldHaveType($arg1, $arg2)
778777
));
779778
}
780779

781-
Assert::eq($arg2, PropertyType::nameFromValue($property->getType()));
780+
\PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType()));
782781
}
783782

784783
/**
@@ -794,8 +793,8 @@ public function thePropertyShouldHaveTypeAndValue($arg1, $arg2, $arg3)
794793
));
795794
}
796795

797-
Assert::eq($arg2, PropertyType::nameFromValue($property->getType()));
798-
Assert::eq($arg3, $property->getValue());
796+
\PHPUnit_Framework_Assert::assertEquals($arg2, PropertyType::nameFromValue($property->getType()));
797+
\PHPUnit_Framework_Assert::assertEquals($arg3, $property->getValue());
799798
}
800799

801800
/**
@@ -865,7 +864,7 @@ public function theNodeShouldBeLocked($arg1)
865864
$lockManager = $workspace->getLockManager();
866865
$isLocked = $lockManager->isLocked($arg1);
867866

868-
Assert::true($isLocked);
867+
\PHPUnit_Framework_Assert::assertTrue($isLocked);
869868
}
870869

871870
/**
@@ -878,7 +877,7 @@ public function theNodeShouldNotBeLocked($arg1)
878877
$lockManager = $workspace->getLockManager();
879878
$isLocked = $lockManager->isLocked($arg1);
880879

881-
Assert::false($isLocked);
880+
\PHPUnit_Framework_Assert::assertFalse($isLocked);
882881
}
883882

884883
/**

0 commit comments

Comments
 (0)