Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3761120
D2515.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D2515.diff
View Options
diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,7 @@
},
"require-dev": {
"phan/phan": "^0.12.3",
- "phpunit/phpunit": "^7",
+ "phpunit/phpunit": "^9.5.13",
"squizlabs/php_codesniffer": "^3"
}
}
diff --git a/phpunit.xml b/phpunit.xml
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,22 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<phpunit bootstrap="vendor/autoload.php"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- stopOnFailure="false">
- <php>
- <ini name="display_errors" value="On" />
- <ini name="display_startup_errors" value="On" />
- <ini name="error_reporting" value="On" />
- </php>
- <testsuites>
- <testsuite name="Unit tests">
- <directory suffix="Test.php">./tests</directory>
- </testsuite>
- </testsuites>
- <filter>
- <whitelist processUncoveredFilesFromWhitelist="true">
- <directory suffix=".php">src/</directory>
- </whitelist>
- </filter>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
+ <coverage processUncoveredFiles="true">
+ <include>
+ <directory suffix=".php">src/</directory>
+ </include>
+ </coverage>
+ <php>
+ <ini name="display_errors" value="On"/>
+ <ini name="display_startup_errors" value="On"/>
+ <ini name="error_reporting" value="On"/>
+ </php>
+ <testsuites>
+ <testsuite name="Unit tests">
+ <directory suffix="Test.php">./tests</directory>
+ </testsuite>
+ </testsuites>
</phpunit>
diff --git a/tests/CommandTest.php b/tests/CommandTest.php
--- a/tests/CommandTest.php
+++ b/tests/CommandTest.php
@@ -21,37 +21,36 @@
private $display;
- public function setUp () {
+ public function setUp () : void {
$this->display = new ArrayDisplay();
$this->command = new SunsetCommand(1, ["sunset"], $this->display);
}
- public function testGetArgc () {
+ public function testGetArgc () : void {
$this->assertEquals(1, $this->command->getArgc());
}
- public function testGetArgv () {
+ public function testGetArgv () : void {
$this->assertEquals(["sunset"], $this->command->getArgv());
}
- public function testGetCommandName() {
+ public function testGetCommandName() : void {
$this->assertEquals("sunset", $this->command->getCommandName());
}
- public function testDisplayBeforeRun() {
+ public function testDisplayBeforeRun() : void {
$this->assertEmpty($this->display->getOut());
$this->assertEmpty($this->display->getError());
}
- public function testDisplayAfterRun() {
+ public function testDisplayAfterRun() : void {
$this->command->main();
$this->assertEquals(1, $this->display->countOut());
$this->assertEquals(0, $this->display->countError());
}
- public function testReturnCode () {
+ public function testReturnCode () : void {
$this->assertEquals(ExitCode::SUCCESS, $this->command->main());
}
}
-
diff --git a/tests/Display/ArrayDisplayTest.php b/tests/Display/ArrayDisplayTest.php
--- a/tests/Display/ArrayDisplayTest.php
+++ b/tests/Display/ArrayDisplayTest.php
@@ -13,11 +13,11 @@
*/
private $display;
- public function setUp () {
+ public function setUp () : void {
$this->display = new ArrayDisplay;
}
- public function testOut () {
+ public function testOut () : void {
$this->display->out("Hello world!");
$this->assertEquals(["Hello world!"], $this->display->getOut());
@@ -27,7 +27,7 @@
$this->assertEquals(0, $this->display->countError());
}
- public function testClearOut () {
+ public function testClearOut () : void {
$this->display->out("Lorem");
$this->display->out("Ipsum");
$this->display->out("Dolor");
@@ -36,7 +36,7 @@
$this->assertEquals(0, $this->display->countOut());
}
- public function testClearError () {
+ public function testClearError () : void {
$this->display->error("Lorem");
$this->display->error("Ipsum");
$this->display->error("Dolor");
@@ -45,7 +45,7 @@
$this->assertEquals(0, $this->display->countError());
}
- public function testCountOut () {
+ public function testCountOut () : void {
$this->display->out("Lorem");
$this->display->out("Ipsum");
$this->display->out("Dolor");
@@ -53,7 +53,7 @@
$this->assertEquals(3, $this->display->countOut());
}
- public function testCountError () {
+ public function testCountError () : void {
$this->display->error("Lorem");
$this->display->error("Ipsum");
$this->display->error("Dolor");
diff --git a/tests/Display/OutputDisplayTest.php b/tests/Display/OutputDisplayTest.php
--- a/tests/Display/OutputDisplayTest.php
+++ b/tests/Display/OutputDisplayTest.php
@@ -13,11 +13,11 @@
*/
private $display;
- public function setUp () {
+ public function setUp () : void {
$this->display = new OutputDisplay;
}
- public function testOut () {
+ public function testOut () : void {
$this->expectOutputString("Hello world!\n");
$this->display->out("Hello world!");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 14:32 (21 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2255201
Default Alt Text
D2515.diff (5 KB)
Attached To
Mode
D2515: Upgrade tests to PHPUnit 9
Attached
Detach File
Event Timeline
Log In to Comment