diff --git a/tests/BaseExceptionTest.php b/tests/BaseExceptionTest.php index 3cf3913..4975528 100644 --- a/tests/BaseExceptionTest.php +++ b/tests/BaseExceptionTest.php @@ -77,11 +77,6 @@ protected function tearDown(): void } - /** - * @covers \Exceptions\BaseException::__construct - * @covers \Exceptions\BaseException::setLoggable - * @covers \Exceptions\BaseException::isLoggable - */ public function testConstruct() { $previous = new \Exception('ex', 2); @@ -103,10 +98,6 @@ public function testConstruct() $this->assertTrue(($this->test_base_data['previous'] === $e->getPrevious()), '$e->getPrevious() failed'); } - /** - * @covers \Exceptions\BaseException::__construct - * @covers \Exceptions\BaseException::getPreviousException - */ public function testConstructAsContainer() { // 1. Случай контейнер для исключения \Exception diff --git a/tests/HelperTraitTest.php b/tests/HelperTraitTest.php index 8a7b89e..2330b94 100644 --- a/tests/HelperTraitTest.php +++ b/tests/HelperTraitTest.php @@ -2,6 +2,8 @@ namespace IfCastle\Exceptions; +use PHPUnit\Framework\Attributes\DataProvider; + class TestedClass { use \IfCastle\Exceptions\HelperTrait { toString as public _toString; @@ -34,7 +36,7 @@ public function testGetSourceFor() $this->assertEquals(__CLASS__.'->testGetSourceFor', $result); } - public function dataProviderGetValueType() + public static function dataProviderGetValueType(): array { $data_set = []; @@ -56,12 +58,11 @@ public function dataProviderGetValueType() } /** - * @dataProvider dataProviderGetValueType - * - * @param mixed $value - * @param string $expected + * @param mixed $value + * @param string $expected */ - public function testGetValueType($value, $expected) + #[DataProvider('dataProviderGetValueType')] + public function testGetValueType(mixed $value, string $expected): void { $testedObject = new TestedClass(); @@ -69,8 +70,8 @@ public function testGetValueType($value, $expected) $this->assertEquals($expected, $result); } - - public function dataProviderToString() + + public static function dataProviderToString(): array { $data_set = []; @@ -111,12 +112,12 @@ public function dataProviderToString() } /** - * @dataProvider dataProviderToString * * @param mixed $value * @param bool $is_quoted * @param string $expected */ + #[DataProvider('dataProviderToString')] public function testToString($value, $is_quoted, $expected) { $testedObject = new TestedClass();