-
-
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.
Do not emit issues in test code for baseline-related end-to-end tests
- Loading branch information
1 parent
6629680
commit 05c1687
Showing
25 changed files
with
505 additions
and
206 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
83 changes: 83 additions & 0 deletions
83
...-end/_files/baseline/generate-baseline-suppressed-with-ignored-suppression/src/Source.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,83 @@ | ||
<?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\Baseline; | ||
|
||
use const E_USER_DEPRECATED; | ||
use const E_USER_NOTICE; | ||
use const E_USER_WARNING; | ||
use function trigger_error; | ||
use Serializable; | ||
|
||
final class Source | ||
{ | ||
public function triggerDeprecation(): void | ||
{ | ||
$this->deprecation(); | ||
} | ||
|
||
public function triggerNotice(): void | ||
{ | ||
$this->notice(); | ||
} | ||
|
||
public function triggerWarning(): void | ||
{ | ||
$this->warning(); | ||
} | ||
|
||
public function triggerPhpDeprecation(): void | ||
{ | ||
$this->phpDeprecation(); | ||
} | ||
|
||
public function triggerPhpNoticeAndWarning(): void | ||
{ | ||
$this->phpNoticeAndWarning(); | ||
} | ||
|
||
private function deprecation(): void | ||
{ | ||
@trigger_error('deprecation', E_USER_DEPRECATED); | ||
} | ||
|
||
private function notice(): void | ||
{ | ||
@trigger_error('notice', E_USER_NOTICE); | ||
} | ||
|
||
private function warning(): void | ||
{ | ||
@trigger_error('warning', E_USER_WARNING); | ||
} | ||
|
||
private function phpDeprecation(): void | ||
{ | ||
@$o = new class implements Serializable | ||
{ | ||
public function serialize(): void | ||
{ | ||
} | ||
|
||
public function unserialize(string $data): void | ||
{ | ||
} | ||
}; | ||
} | ||
|
||
private function phpNoticeAndWarning(): void | ||
{ | ||
$o = new class | ||
{ | ||
public static $a = 'b'; | ||
}; | ||
|
||
@$o->a; | ||
} | ||
} |
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
83 changes: 83 additions & 0 deletions
83
tests/end-to-end/_files/baseline/generate-baseline-suppressed/src/Source.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,83 @@ | ||
<?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\Baseline; | ||
|
||
use const E_USER_DEPRECATED; | ||
use const E_USER_NOTICE; | ||
use const E_USER_WARNING; | ||
use function trigger_error; | ||
use Serializable; | ||
|
||
final class Source | ||
{ | ||
public function triggerDeprecation(): void | ||
{ | ||
$this->deprecation(); | ||
} | ||
|
||
public function triggerNotice(): void | ||
{ | ||
$this->notice(); | ||
} | ||
|
||
public function triggerWarning(): void | ||
{ | ||
$this->warning(); | ||
} | ||
|
||
public function triggerPhpDeprecation(): void | ||
{ | ||
$this->phpDeprecation(); | ||
} | ||
|
||
public function triggerPhpNoticeAndWarning(): void | ||
{ | ||
$this->phpNoticeAndWarning(); | ||
} | ||
|
||
private function deprecation(): void | ||
{ | ||
@trigger_error('deprecation', E_USER_DEPRECATED); | ||
} | ||
|
||
private function notice(): void | ||
{ | ||
@trigger_error('notice', E_USER_NOTICE); | ||
} | ||
|
||
private function warning(): void | ||
{ | ||
@trigger_error('warning', E_USER_WARNING); | ||
} | ||
|
||
private function phpDeprecation(): void | ||
{ | ||
@$o = new class implements Serializable | ||
{ | ||
public function serialize(): void | ||
{ | ||
} | ||
|
||
public function unserialize(string $data): void | ||
{ | ||
} | ||
}; | ||
} | ||
|
||
private function phpNoticeAndWarning(): void | ||
{ | ||
$o = new class | ||
{ | ||
public static $a = 'b'; | ||
}; | ||
|
||
@$o->a; | ||
} | ||
} |
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
Oops, something went wrong.