VerifyDeprecationsTest.php 842 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Deprecations;
  4. use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
  5. use PHPUnit\Framework\TestCase;
  6. use function set_error_handler;
  7. class VerifyDeprecationsTest extends TestCase
  8. {
  9. use VerifyDeprecations;
  10. public function setUp(): void
  11. {
  12. set_error_handler(static function (): void {
  13. });
  14. }
  15. public function testExpectDeprecationWithIdentifier(): void
  16. {
  17. $this->expectDeprecationWithIdentifier('http://example.com');
  18. Deprecation::trigger('doctrine/dbal', 'http://example.com', 'message');
  19. }
  20. public function testExpectNoDeprecationWithIdentifier(): void
  21. {
  22. $this->expectNoDeprecationWithIdentifier('http://example.com');
  23. Deprecation::trigger('doctrine/dbal', 'http://otherexample.com', 'message');
  24. }
  25. }