@@ -14,7 +14,7 @@ class TestDoubleTest extends TestCase
14
14
public function test_getDouble_method_named_method (): void
15
15
{
16
16
$ expected = 'DELETE ' ;
17
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
17
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
18
18
19
19
$ actual = $ mock ->method ();
20
20
@@ -25,7 +25,7 @@ public function test_getDouble_method_returns_consecutive(): void
25
25
{
26
26
$ returns = ['GET ' , 'PUT ' , 'DELETE ' ];
27
27
$ mock = $ this ->getDouble (
28
- CI_Input ::class,
28
+ Input ::class,
29
29
[
30
30
['method ' => $ returns ],
31
31
]
@@ -45,7 +45,7 @@ public function test_getDouble_returns_consecutive_and_other(): void
45
45
{
46
46
$ returns = ['GET ' , 'PUT ' , 'DELETE ' ];
47
47
$ mock = $ this ->getDouble (
48
- CI_Input ::class,
48
+ Input ::class,
49
49
[
50
50
'get ' => [],
51
51
['method ' => $ returns ],
@@ -71,14 +71,19 @@ public function test_getDouble_returns_consecutive_and_other(): void
71
71
public function test_getDouble_method_returns_execption (): void
72
72
{
73
73
$ 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
+ );
75
77
76
78
$ 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
+ );
78
83
};
79
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ ret ]);
84
+ $ mock = $ this ->getDouble (Input ::class, ['get ' => $ ret ]);
80
85
81
- $ mock ->method ('abc ' , ' def ' );
86
+ $ mock ->get ('abc ' , true );
82
87
}
83
88
84
89
public function test_getDouble_constructor_param (): void
@@ -97,7 +102,7 @@ public function test_getDouble_constructor_param(): void
97
102
98
103
public function test_getDobule_method_returns_phpunit_stub (): void
99
104
{
100
- $ mock = $ this ->getDouble (CI_Email ::class, ['to ' => $ this ->returnSelf ()]);
105
+ $ mock = $ this ->getDouble (Email ::class, ['to ' => $ this ->returnSelf ()]);
101
106
$ test = $ mock ->to ('test@example.com ' );
102
107
103
108
$ this ->assertEquals ($ mock , $ test );
@@ -106,7 +111,7 @@ public function test_getDobule_method_returns_phpunit_stub(): void
106
111
public function test_verifyInvokedOnce_with_params (): void
107
112
{
108
113
$ expected = 'DELETE ' ;
109
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
114
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
110
115
111
116
$ this ->verifyInvokedOnce ($ mock , 'method ' , [true ]);
112
117
@@ -116,7 +121,7 @@ public function test_verifyInvokedOnce_with_params(): void
116
121
public function test_verifyInvokedOnce_without_params (): void
117
122
{
118
123
$ expected = 'DELETE ' ;
119
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
124
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
120
125
121
126
$ this ->verifyInvokedOnce ($ mock , 'method ' );
122
127
@@ -126,7 +131,7 @@ public function test_verifyInvokedOnce_without_params(): void
126
131
public function test_verifyInvoked_once (): void
127
132
{
128
133
$ expected = 'DELETE ' ;
129
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
134
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
130
135
131
136
$ this ->verifyInvoked ($ mock , 'method ' );
132
137
@@ -136,7 +141,7 @@ public function test_verifyInvoked_once(): void
136
141
public function test_verifyInvoked_twice (): void
137
142
{
138
143
$ expected = 'DELETE ' ;
139
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
144
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
140
145
141
146
$ this ->verifyInvoked ($ mock , 'method ' );
142
147
@@ -147,7 +152,7 @@ public function test_verifyInvoked_twice(): void
147
152
public function test_verifyInvokedMultipleTimes (): void
148
153
{
149
154
$ expected = 'DELETE ' ;
150
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
155
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
151
156
152
157
$ this ->verifyInvokedMultipleTimes ($ mock , 'method ' , 3 );
153
158
@@ -159,7 +164,7 @@ public function test_verifyInvokedMultipleTimes(): void
159
164
public function test_verifyNeverInvoked (): void
160
165
{
161
166
$ expected = 'DELETE ' ;
162
- $ mock = $ this ->getDouble (CI_Input ::class, ['method ' => $ expected ]);
167
+ $ mock = $ this ->getDouble (Input ::class, ['method ' => $ expected ]);
163
168
164
169
$ this ->verifyNeverInvoked ($ mock , 'method ' );
165
170
}
0 commit comments