@@ -14,7 +14,7 @@ class TestDoubleTest extends TestCase
1414 public function test_getDouble_method_named_method (): void
1515 {
1616 $ expected = 'DELETE ' ;
17- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
17+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
1818
1919 $ actual = $ mock ->method ();
2020
@@ -25,7 +25,7 @@ public function test_getDouble_method_returns_consecutive(): void
2525 {
2626 $ returns = ['GET ' , 'PUT ' , 'DELETE ' ];
2727 $ mock = $ this ->getDouble (
28- CI_Input ::class,
28+ Input ::class,
2929 [
3030 ['method ' => $ returns ],
3131 ]
@@ -45,7 +45,7 @@ public function test_getDouble_returns_consecutive_and_other(): void
4545 {
4646 $ returns = ['GET ' , 'PUT ' , 'DELETE ' ];
4747 $ mock = $ this ->getDouble (
48- CI_Input ::class,
48+ Input ::class,
4949 [
5050 'get ' => [],
5151 ['method ' => $ returns ],
@@ -71,14 +71,19 @@ public function test_getDouble_returns_consecutive_and_other(): void
7171 public function test_getDouble_method_returns_execption (): void
7272 {
7373 $ this ->expectException (RuntimeException::class);
74- $ this ->expectExceptionMessage ('I can throw an exception and can use params: abcdef ' );
74+ $ this ->expectExceptionMessage (
75+ 'I can throw an exception and can use params: abc1 '
76+ );
7577
7678 $ ret = static function ($ param1 , $ param2 ): void {
77- throw new RuntimeException ('I can throw an exception and can use params: ' . $ param1 . $ param2 );
79+ throw new RuntimeException (
80+ 'I can throw an exception and can use params: '
81+ . $ param1 . $ param2
82+ );
7883 };
79- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ ret ]);
84+ $ mock = $ this ->getDouble (Input ::class, ['get ' => $ ret ]);
8085
81- $ mock ->method ('abc ' , ' def ' );
86+ $ mock ->get ('abc ' , true );
8287 }
8388
8489 public function test_getDouble_constructor_param (): void
@@ -97,7 +102,7 @@ public function test_getDouble_constructor_param(): void
97102
98103 public function test_getDobule_method_returns_phpunit_stub (): void
99104 {
100- $ mock = $ this ->getDouble (CI_Email ::class, ['to ' => $ this ->returnSelf ()]);
105+ $ mock = $ this ->getDouble (Email ::class, ['to ' => $ this ->returnSelf ()]);
101106 $ test = $ mock ->to ('test@example.com ' );
102107
103108 $ this ->assertEquals ($ mock , $ test );
@@ -106,7 +111,7 @@ public function test_getDobule_method_returns_phpunit_stub(): void
106111 public function test_verifyInvokedOnce_with_params (): void
107112 {
108113 $ expected = 'DELETE ' ;
109- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
114+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
110115
111116 $ this ->verifyInvokedOnce ($ mock , 'method ' , [true ]);
112117
@@ -116,7 +121,7 @@ public function test_verifyInvokedOnce_with_params(): void
116121 public function test_verifyInvokedOnce_without_params (): void
117122 {
118123 $ expected = 'DELETE ' ;
119- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
124+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
120125
121126 $ this ->verifyInvokedOnce ($ mock , 'method ' );
122127
@@ -126,7 +131,7 @@ public function test_verifyInvokedOnce_without_params(): void
126131 public function test_verifyInvoked_once (): void
127132 {
128133 $ expected = 'DELETE ' ;
129- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
134+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
130135
131136 $ this ->verifyInvoked ($ mock , 'method ' );
132137
@@ -136,7 +141,7 @@ public function test_verifyInvoked_once(): void
136141 public function test_verifyInvoked_twice (): void
137142 {
138143 $ expected = 'DELETE ' ;
139- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
144+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
140145
141146 $ this ->verifyInvoked ($ mock , 'method ' );
142147
@@ -147,7 +152,7 @@ public function test_verifyInvoked_twice(): void
147152 public function test_verifyInvokedMultipleTimes (): void
148153 {
149154 $ expected = 'DELETE ' ;
150- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
155+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
151156
152157 $ this ->verifyInvokedMultipleTimes ($ mock , 'method ' , 3 );
153158
@@ -159,7 +164,7 @@ public function test_verifyInvokedMultipleTimes(): void
159164 public function test_verifyNeverInvoked (): void
160165 {
161166 $ expected = 'DELETE ' ;
162- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
167+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
163168
164169 $ this ->verifyNeverInvoked ($ mock , 'method ' );
165170 }
0 commit comments