@@ -184,7 +184,7 @@ public function testArrayifyCircularReference(\stdClass $object)
184
184
{
185
185
arrayify ($ object );
186
186
}
187
-
187
+
188
188
189
189
public function expectTypeProvider ()
190
190
{
@@ -195,7 +195,7 @@ public function expectTypeProvider()
195
195
[(object )[], 'stdClass ' ],
196
196
[10 , ['int ' , 'boolean ' ]],
197
197
['foo ' , 'int ' , "Expected int, string given " ],
198
- ['foo ' , ['int ' , 'boolean ' ], "Expected int or bool , string given " ],
198
+ ['foo ' , ['int ' , 'boolean ' ], "Expected int or boolean , string given " ],
199
199
[(object )[], 'Foo ' , "Expected Foo object, stdClass object given " ],
200
200
];
201
201
}
@@ -211,22 +211,11 @@ public function expectTypeProvider()
211
211
public function testExpectType ($ var , $ type , $ error = false )
212
212
{
213
213
if ($ error ) {
214
- $ this ->expectException (class_exists ( ' TypeError ' ) ? ' TypeError ' : ' InvalidArgumentException ' );
214
+ $ this ->expectException (\ InvalidArgumentException::class );
215
215
$ this ->expectExceptionMessage ($ error );
216
216
}
217
217
218
- expect_type ($ var , $ type );
219
- }
220
-
221
- /**
222
- * @covers Jasny\expect_type
223
- *
224
- * @expectedException UnexpectedValueException
225
- * @expectedExceptionMessage Expected int, string given
226
- */
227
- public function testExpectTypeExplicitThrowable ()
228
- {
229
- expect_type ('foo ' , 'int ' , \UnexpectedValueException::class);
218
+ expect_type ($ var , $ type , \InvalidArgumentException::class);
230
219
}
231
220
232
221
/**
0 commit comments