Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 412645f

Browse files
committed
update to modern class names
1 parent cc03f31 commit 412645f

20 files changed

+235
-270
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"autoload":{
1919
"psr-4":{
20-
"Codeception\\PHPUnit": "src\\"
20+
"Codeception\\PHPUnit\\": "src\\"
2121
}
2222
}
2323
}

src/ConsolePrinter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ interface ConsolePrinter
1111
{
1212
public function write($buffer);
1313

14-
public function printResult(\PHPUnit_Framework_TestResult $result);
14+
public function printResult(\PHPUnit\Framework\TestResult $result);
1515
}

src/Constraint/Crawler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function fail($nodes, $selector, ComparisonFailure $comparisonFailure
4545
}
4646
$output .= "\ncontains text '{$this->string}'";
4747

48-
throw new \PHPUnit_Framework_ExpectationFailedException(
48+
throw new \PHPUnit\Framework\ExpectationFailedException(
4949
$output,
5050
$comparisonFailure
5151
);

src/Constraint/CrawlerNot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected function matches($nodes)
1313
protected function fail($nodes, $selector, ComparisonFailure $comparisonFailure = null)
1414
{
1515
if (!$this->string) {
16-
throw new \PHPUnit_Framework_ExpectationFailedException(
16+
throw new \PHPUnit\Framework\ExpectationFailedException(
1717
"Element '$selector' was found",
1818
$comparisonFailure
1919
);
@@ -25,7 +25,7 @@ protected function fail($nodes, $selector, ComparisonFailure $comparisonFailure
2525
$output .= $this->nodesList($nodes, $this->string);
2626
$output .= "\ncontaining '{$this->string}'";
2727

28-
throw new \PHPUnit_Framework_ExpectationFailedException(
28+
throw new \PHPUnit\Framework\ExpectationFailedException(
2929
$output,
3030
$comparisonFailure
3131
);

src/Constraint/JsonContains.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use SebastianBergmann\Comparator\Factory;
88
use Codeception\Util\JsonArray;
99

10-
class JsonContains extends \PHPUnit_Framework_Constraint
10+
class JsonContains extends \PHPUnit\Framework\Constraint
1111
{
1212
/**
1313
* @var
@@ -32,7 +32,7 @@ protected function matches($other)
3232
{
3333
$jsonResponseArray = new JsonArray($other);
3434
if (!is_array($jsonResponseArray->toArray())) {
35-
throw new \PHPUnit_Framework_AssertionFailedError('JSON response is not an array: ' . $other);
35+
throw new \PHPUnit\Framework\AssertionFailedError('JSON response is not an array: ' . $other);
3636
}
3737

3838
if ($jsonResponseArray->containsArray($this->expected)) {
@@ -44,7 +44,7 @@ protected function matches($other)
4444
try {
4545
$comparator->assertEquals($this->expected, $jsonResponseArray->toArray());
4646
} catch (ComparisonFailure $failure) {
47-
throw new \PHPUnit_Framework_ExpectationFailedException(
47+
throw new \PHPUnit\Framework\ExpectationFailedException(
4848
"Response JSON does not contain the provided JSON\n",
4949
$failure
5050
);

src/Constraint/JsonType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Codeception\Util\JsonType as JsonTypeUtil;
66
use Codeception\Util\JsonArray;
77

8-
class JsonType extends \PHPUnit_Framework_Constraint
8+
class JsonType extends \PHPUnit\Framework\Constraint
99
{
1010
protected $jsonType;
1111
private $match;
@@ -35,11 +35,11 @@ protected function matches($jsonArray)
3535

3636
if ($this->match) {
3737
if ($matched !== true) {
38-
throw new \PHPUnit_Framework_ExpectationFailedException($matched);
38+
throw new \PHPUnit\Framework\ExpectationFailedException($matched);
3939
}
4040
} else {
4141
if ($matched === true) {
42-
throw new \PHPUnit_Framework_ExpectationFailedException('Unexpectedly response matched: ' . json_encode($jsonArray));
42+
throw new \PHPUnit\Framework\ExpectationFailedException('Unexpectedly response matched: ' . json\encode($jsonArray));
4343
}
4444
}
4545
return true;

src/Constraint/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use Codeception\Lib\Console\Message;
55

6-
class Page extends \PHPUnit_Framework_Constraint
6+
class Page extends \PHPUnit\Framework\Constraint
77
{
88
protected $uri;
99

src/Constraint/WebDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function fail($nodes, $selector, ComparisonFailure $comparisonFailure
4848
}
4949
$output .= "\ncontains text '" . $this->string . "'";
5050

51-
throw new \PHPUnit_Framework_ExpectationFailedException(
51+
throw new \PHPUnit\Framework\ExpectationFailedException(
5252
$output,
5353
$comparisonFailure
5454
);

src/Constraint/WebDriverNot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected function fail($nodes, $selector, ComparisonFailure $comparisonFailure
1515
{
1616
$selectorString = Locator::humanReadableString($selector);
1717
if (!$this->string) {
18-
throw new \PHPUnit_Framework_ExpectationFailedException(
18+
throw new \PHPUnit\Framework\ExpectationFailedException(
1919
"Element $selectorString was found",
2020
$comparisonFailure
2121
);
@@ -26,7 +26,7 @@ protected function fail($nodes, $selector, ComparisonFailure $comparisonFailure
2626
$output .= $this->nodesList($nodes, $this->string);
2727
$output .= "\ncontaining '{$this->string}'";
2828

29-
throw new \PHPUnit_Framework_ExpectationFailedException(
29+
throw new \PHPUnit\Framework\ExpectationFailedException(
3030
$output,
3131
$comparisonFailure
3232
);

src/FilterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
* Class FilterTest
1010
* @package Codeception\PHPUnit
1111
*/
12-
class FilterTest extends \PHPUnit_Runner_Filter_Test
12+
class FilterTest extends \PHPUnit\Runner\Filter\NameFilterIterator
1313
{
1414
public function accept()
1515
{
1616
$test = $this->getInnerIterator()->current();
1717

18-
if ($test instanceof \PHPUnit_Framework_TestSuite) {
18+
if ($test instanceof \PHPUnit\Framework\TestSuite) {
1919
return true;
2020
}
2121

0 commit comments

Comments
 (0)