2
2
3
3
namespace PetrKnap \Php \Enum \Test ;
4
4
5
+ use PetrKnap \Php \Enum \Enum ;
6
+ use PetrKnap \Php \Enum \Exception \EnumException ;
5
7
use PetrKnap \Php \Enum \Exception \EnumNotFoundException ;
6
8
use PetrKnap \Php \Enum \Test \EnumTest \MyBoolean ;
7
9
@@ -10,11 +12,11 @@ class EnumTest extends \PHPUnit_Framework_TestCase
10
12
/**
11
13
* @dataProvider dataCallStaticsWorks
12
14
* @param string $name
13
- * @param mixed $expectedValue
15
+ * @param mixed|EnumException $expectedValue
14
16
*/
15
17
public function testCallStaticsWorks ($ name , $ expectedValue )
16
18
{
17
- if ($ expectedValue instanceof \Exception ) {
19
+ if ($ expectedValue instanceof EnumException ) {
18
20
$ this ->setExpectedException (get_class ($ expectedValue ));
19
21
}
20
22
@@ -33,11 +35,11 @@ public function dataCallStaticsWorks()
33
35
/**
34
36
* @dataProvider dataGetEnumByValueWorks
35
37
* @param mixed $value
36
- * @param mixed $expectedEnum
38
+ * @param Enum|EnumException $expectedEnum
37
39
*/
38
40
public function testGetEnumByValueWorks ($ value , $ expectedEnum )
39
41
{
40
- if ($ expectedEnum instanceof \Exception ) {
42
+ if ($ expectedEnum instanceof EnumException ) {
41
43
$ this ->setExpectedException (get_class ($ expectedEnum ));
42
44
}
43
45
@@ -72,10 +74,10 @@ public function testGetMembersWorks()
72
74
73
75
/**
74
76
* @dataProvider dataToStringWorks
75
- * @param mixed $enum
76
- * @param mixed $expectedString
77
+ * @param Enum $enum
78
+ * @param string $expectedString
77
79
*/
78
- public function testToStringWorks ($ enum , $ expectedString )
80
+ public function testToStringWorks (Enum $ enum , $ expectedString )
79
81
{
80
82
$ this ->assertSame ($ expectedString , $ enum ->__toString ());
81
83
$ this ->assertSame ($ expectedString , (string ) $ enum );
0 commit comments