-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2a23b7
commit 6fa4160
Showing
11 changed files
with
270 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\TestDox; | ||
|
||
use function trigger_error; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class DeprecationTest extends TestCase | ||
{ | ||
public function testDeprecation(): void | ||
{ | ||
trigger_error('deprecation', E_USER_DEPRECATED); | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\TestDox; | ||
|
||
use function trigger_error; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class NoticeTest extends TestCase | ||
{ | ||
public function testNotice(): void | ||
{ | ||
trigger_error('notice', E_USER_NOTICE); | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\TestDox; | ||
|
||
use function trigger_error; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class WarningTest extends TestCase | ||
{ | ||
public function testWarning(): void | ||
{ | ||
trigger_error('warning', E_USER_WARNING); | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/end-to-end/testdox/test-that-triggers-deprecation-default.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
TestDox: Test triggers deprecation and --display-deprecations is not used | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-progress'; | ||
$_SERVER['argv'][] = '--testdox'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/DeprecationTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
|
||
Time: %s, Memory: %s | ||
|
||
Deprecation (PHPUnit\TestFixture\TestDox\Deprecation) | ||
✔ Deprecation | ||
|
||
OK, but there were issues! | ||
Tests: 1, Assertions: 1, Deprecations: 1. |
37 changes: 37 additions & 0 deletions
37
tests/end-to-end/testdox/test-that-triggers-deprecation-details.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
TestDox: Test triggers deprecation and --display-deprecations is used | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-progress'; | ||
$_SERVER['argv'][] = '--testdox'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = '--display-deprecations'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/DeprecationTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
|
||
Time: %s, Memory: %s | ||
|
||
Deprecation (PHPUnit\TestFixture\TestDox\Deprecation) | ||
✔ Deprecation | ||
|
||
1 test triggered 1 deprecation: | ||
|
||
1) %sDeprecationTest.php:19 | ||
deprecation | ||
|
||
Triggered by: | ||
|
||
* PHPUnit\TestFixture\TestDox\DeprecationTest::testDeprecation | ||
%sDeprecationTest.php:17 | ||
|
||
OK, but there were issues! | ||
Tests: 1, Assertions: 1, Deprecations: 1. |
26 changes: 26 additions & 0 deletions
26
tests/end-to-end/testdox/test-that-triggers-notice-default.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
TestDox: Test triggers notice and --display-notices is not used | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-progress'; | ||
$_SERVER['argv'][] = '--testdox'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/NoticeTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
|
||
Time: %s, Memory: %s | ||
|
||
Notice (PHPUnit\TestFixture\TestDox\Notice) | ||
✔ Notice | ||
|
||
OK, but there were issues! | ||
Tests: 1, Assertions: 1, Notices: 1. |
37 changes: 37 additions & 0 deletions
37
tests/end-to-end/testdox/test-that-triggers-notice-details.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
TestDox: Test triggers notice and --display-notices is used | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-progress'; | ||
$_SERVER['argv'][] = '--testdox'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = '--display-notices'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/NoticeTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
|
||
Time: %s, Memory: %s | ||
|
||
Notice (PHPUnit\TestFixture\TestDox\Notice) | ||
✔ Notice | ||
|
||
1 test triggered 1 notice: | ||
|
||
1) %sNoticeTest.php:19 | ||
notice | ||
|
||
Triggered by: | ||
|
||
* PHPUnit\TestFixture\TestDox\NoticeTest::testNotice | ||
%sNoticeTest.php:17 | ||
|
||
OK, but there were issues! | ||
Tests: 1, Assertions: 1, Notices: 1. |
26 changes: 26 additions & 0 deletions
26
tests/end-to-end/testdox/test-that-triggers-warning-default.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
TestDox: Test triggers warning and --display-warning is not used | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-progress'; | ||
$_SERVER['argv'][] = '--testdox'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/WarningTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
|
||
Time: %s, Memory: %s | ||
|
||
Warning (PHPUnit\TestFixture\TestDox\Warning) | ||
✔ Warning | ||
|
||
OK, but there were issues! | ||
Tests: 1, Assertions: 1, Warnings: 1. |
37 changes: 37 additions & 0 deletions
37
tests/end-to-end/testdox/test-that-triggers-warning-details.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
TestDox: Test triggers warning and --display-warning is used | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-progress'; | ||
$_SERVER['argv'][] = '--testdox'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = '--display-warnings'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/WarningTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
|
||
Time: %s, Memory: %s | ||
|
||
Warning (PHPUnit\TestFixture\TestDox\Warning) | ||
✔ Warning | ||
|
||
1 test triggered 1 warning: | ||
|
||
1) %sWarningTest.php:19 | ||
warning | ||
|
||
Triggered by: | ||
|
||
* PHPUnit\TestFixture\TestDox\WarningTest::testWarning | ||
%sWarningTest.php:17 | ||
|
||
OK, but there were issues! | ||
Tests: 1, Assertions: 1, Warnings: 1. |