-
-
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
683009b
commit 22250e1
Showing
8 changed files
with
72 additions
and
9 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
tests/end-to-end/self-direct-indirect/_files/deprecation-in-test-code-ignored/phpunit.xml
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../phpunit.xsd" | ||
> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<source ignoreSelfDeprecations="true" restrictNotices="true" restrictWarnings="true"> | ||
<include> | ||
<directory>src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
tests/end-to-end/regression/6028/phpunit.xml → ...iles/deprecation-in-test-code/phpunit.xml
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
Empty file.
24 changes: 24 additions & 0 deletions
24
.../self-direct-indirect/_files/deprecation-in-test-code/tests/DeprecationInTestCodeTest.php
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,24 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\SelfDirectIndirect; | ||
|
||
use const E_USER_DEPRECATED; | ||
use function trigger_error; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class DeprecationInTestCodeTest extends TestCase | ||
{ | ||
public function testOne(): void | ||
{ | ||
trigger_error('message', E_USER_DEPRECATED); | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/end-to-end/self-direct-indirect/deprecation-in-test-code-ignored.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,23 @@ | ||
--TEST-- | ||
Deprecation in test code is not reported when it is configured to not be reported | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--display-deprecations'; | ||
$_SERVER['argv'][] = '--configuration'; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/deprecation-in-test-code-ignored'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
Configuration: %sphpunit.xml | ||
|
||
. 1 / 1 (100%) | ||
|
||
Time: %s, Memory: %s | ||
|
||
OK (1 test, 1 assertion) |
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