Skip to content

Commit

Permalink
* fix UnitTests
Browse files Browse the repository at this point in the history
  • Loading branch information
EdmondDantes committed Jul 16, 2024
1 parent 5bf67a1 commit 1d2a7c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
9 changes: 0 additions & 9 deletions tests/BaseExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
19 changes: 10 additions & 9 deletions tests/HelperTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace IfCastle\Exceptions;

use PHPUnit\Framework\Attributes\DataProvider;

class TestedClass {
use \IfCastle\Exceptions\HelperTrait {
toString as public _toString;
Expand Down Expand Up @@ -34,7 +36,7 @@ public function testGetSourceFor()
$this->assertEquals(__CLASS__.'->testGetSourceFor', $result);
}

public function dataProviderGetValueType()
public static function dataProviderGetValueType(): array
{
$data_set = [];

Expand All @@ -56,21 +58,20 @@ 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();

$result = $testedObject->_getValueType($value);

$this->assertEquals($expected, $result);
}

public function dataProviderToString()
public static function dataProviderToString(): array
{
$data_set = [];

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 1d2a7c6

Please sign in to comment.