Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit 5df8111

Browse files
author
Petr Knap
committed
Added type hints to tests
1 parent c0719ce commit 5df8111

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/Enum/EnumTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace PetrKnap\Php\Enum\Test;
44

5+
use PetrKnap\Php\Enum\Enum;
6+
use PetrKnap\Php\Enum\Exception\EnumException;
57
use PetrKnap\Php\Enum\Exception\EnumNotFoundException;
68
use PetrKnap\Php\Enum\Test\EnumTest\MyBoolean;
79

@@ -10,11 +12,11 @@ class EnumTest extends \PHPUnit_Framework_TestCase
1012
/**
1113
* @dataProvider dataCallStaticsWorks
1214
* @param string $name
13-
* @param mixed $expectedValue
15+
* @param mixed|EnumException $expectedValue
1416
*/
1517
public function testCallStaticsWorks($name, $expectedValue)
1618
{
17-
if ($expectedValue instanceof \Exception) {
19+
if ($expectedValue instanceof EnumException) {
1820
$this->setExpectedException(get_class($expectedValue));
1921
}
2022

@@ -33,11 +35,11 @@ public function dataCallStaticsWorks()
3335
/**
3436
* @dataProvider dataGetEnumByValueWorks
3537
* @param mixed $value
36-
* @param mixed $expectedEnum
38+
* @param Enum|EnumException $expectedEnum
3739
*/
3840
public function testGetEnumByValueWorks($value, $expectedEnum)
3941
{
40-
if ($expectedEnum instanceof \Exception) {
42+
if ($expectedEnum instanceof EnumException) {
4143
$this->setExpectedException(get_class($expectedEnum));
4244
}
4345

@@ -72,10 +74,10 @@ public function testGetMembersWorks()
7274

7375
/**
7476
* @dataProvider dataToStringWorks
75-
* @param mixed $enum
76-
* @param mixed $expectedString
77+
* @param Enum $enum
78+
* @param string $expectedString
7779
*/
78-
public function testToStringWorks($enum, $expectedString)
80+
public function testToStringWorks(Enum $enum, $expectedString)
7981
{
8082
$this->assertSame($expectedString, $enum->__toString());
8183
$this->assertSame($expectedString, (string) $enum);

0 commit comments

Comments
 (0)