22
33namespace PetrKnap \Php \Enum \Test ;
44
5+ use PetrKnap \Php \Enum \Enum ;
6+ use PetrKnap \Php \Enum \Exception \EnumException ;
57use PetrKnap \Php \Enum \Exception \EnumNotFoundException ;
68use 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