Skip to content

Commit

Permalink
Merge pull request #73 from greg0ire/risky-test
Browse files Browse the repository at this point in the history
Rework risky test
greg0ire authored Dec 14, 2024
2 parents 31610db + 1f3a9e6 commit e48ead5
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions tests/DeprecationTest.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
use Psr\Log\LoggerInterface;
use ReflectionClass;
use ReflectionProperty;
use Throwable;

use function method_exists;
use function set_error_handler;
@@ -139,22 +138,19 @@ public function testDeprecationWithoutDeduplication(): void
$this->assertEquals(2, Deprecation::getUniqueTriggeredDeprecationsCount());
}

public function testDeprecationResetsCounts(): void
public function testDisableResetsCounts(): void
{
try {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/deprecations/1234',
'this is deprecated %s %d',
'foo',
1234
);
} catch (Throwable $e) {
Deprecation::disable();
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/deprecations/1234',
'this is deprecated %s %d',
'foo',
1234
);
Deprecation::disable();

$this->assertEquals(0, Deprecation::getUniqueTriggeredDeprecationsCount());
$this->assertEquals(['https://github.com/doctrine/deprecations/1234' => 0], Deprecation::getTriggeredDeprecations());
}
$this->assertEquals(0, Deprecation::getUniqueTriggeredDeprecationsCount());
$this->assertEquals(['https://github.com/doctrine/deprecations/1234' => 0], Deprecation::getTriggeredDeprecations());
}

public function expectDeprecationMock(string $message, string $identifier, string $package): LoggerInterface

0 comments on commit e48ead5

Please sign in to comment.