Skip to content

Commit 1ea7b72

Browse files
committed
Replace assertInternalType with actual type checks (deprecated)
1 parent 3ae10fd commit 1ea7b72

7 files changed

Lines changed: 19 additions & 20 deletions

File tree

tests/system/Cache/Handlers/RedisHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testGetCacheInfo()
135135
{
136136
$this->redisHandler->save(self::$key1, 'value');
137137

138-
$this->assertInternalType('array', $this->redisHandler->getCacheInfo());
138+
$this->assertIsArray($this->redisHandler->getCacheInfo());
139139
}
140140

141141
public function testGetMetaData()

tests/system/Database/Live/ModelTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function testFindRespectsReturnArray()
122122
$job = $model->asArray()
123123
->find(4);
124124

125-
$this->assertInternalType('array', $job);
125+
$this->assertIsArray($job);
126126
}
127127

128128
//--------------------------------------------------------------------
@@ -134,7 +134,7 @@ public function testFindRespectsReturnObject()
134134
$job = $model->asObject()
135135
->find(4);
136136

137-
$this->assertInternalType('object', $job);
137+
$this->assertIsObject($job);
138138
}
139139

140140
//--------------------------------------------------------------------
@@ -662,8 +662,7 @@ public function testSkipValidation()
662662
'description' => 'some great marketing stuff',
663663
];
664664

665-
$this->assertInternalType('numeric', $model->skipValidation(true)
666-
->insert($data));
665+
$this->assertIsNumeric($model->skipValidation(true)->insert($data));
667666
}
668667

669668
//--------------------------------------------------------------------

tests/system/EntityTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public function testCastInteger()
277277
$entity = $this->getCastEntity();
278278

279279
$entity->first = 3.1;
280-
$this->assertInternalType('integer', $entity->first);
280+
$this->assertIsInt($entity->first);
281281
$this->assertEquals(3, $entity->first);
282282

283283
$entity->first = 3.6;
@@ -289,11 +289,11 @@ public function testCastFloat()
289289
$entity = $this->getCastEntity();
290290

291291
$entity->second = 3;
292-
$this->assertInternalType('float', $entity->second);
292+
$this->assertIsFloat($entity->second);
293293
$this->assertEquals(3.0, $entity->second);
294294

295295
$entity->second = '3.6';
296-
$this->assertInternalType('float', $entity->second);
296+
$this->assertIsFloat($entity->second);
297297
$this->assertEquals(3.6, $entity->second);
298298
}
299299

@@ -302,11 +302,11 @@ public function testCastDouble()
302302
$entity = $this->getCastEntity();
303303

304304
$entity->third = 3;
305-
$this->assertInternalType('double', $entity->third);
305+
$this->assertIsFloat($entity->third);
306306
$this->assertSame(3.0, $entity->third);
307307

308308
$entity->third = '3.6';
309-
$this->assertInternalType('double', $entity->third);
309+
$this->assertIsFloat($entity->third);
310310
$this->assertSame(3.6, $entity->third);
311311
}
312312

@@ -315,7 +315,7 @@ public function testCastString()
315315
$entity = $this->getCastEntity();
316316

317317
$entity->fourth = 3.1415;
318-
$this->assertInternalType('string', $entity->fourth);
318+
$this->assertIsString($entity->fourth);
319319
$this->assertSame('3.1415', $entity->fourth);
320320
}
321321

@@ -324,11 +324,11 @@ public function testCastBoolean()
324324
$entity = $this->getCastEntity();
325325

326326
$entity->fifth = 1;
327-
$this->assertInternalType('bool', $entity->fifth);
327+
$this->assertIsBool($entity->fifth);
328328
$this->assertTrue($entity->fifth);
329329

330330
$entity->fifth = 0;
331-
$this->assertInternalType('bool', $entity->fifth);
331+
$this->assertIsBool($entity->fifth);
332332
$this->assertFalse($entity->fifth);
333333
}
334334

@@ -339,7 +339,7 @@ public function testCastObject()
339339
$data = ['foo' => 'bar'];
340340

341341
$entity->sixth = $data;
342-
$this->assertInternalType('object', $entity->sixth);
342+
$this->assertIsObject($entity->sixth);
343343
$this->assertEquals((object) $data, $entity->sixth);
344344
}
345345

@@ -359,7 +359,7 @@ public function testCastTimestamp()
359359
$date = 'March 12, 2017';
360360

361361
$entity->ninth = $date;
362-
$this->assertInternalType('integer', $entity->ninth);
362+
$this->assertIsInt($entity->ninth);
363363
$this->assertEquals(strtotime($date), $entity->ninth);
364364
}
365365

tests/system/HTTP/CLIRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public function testFetchGlobalReturnsArrayValues()
376376
$result = $this->request->fetchGlobal('post');
377377

378378
$this->assertEquals($post, $result);
379-
$this->assertInternalType('array', $result['ANNOUNCEMENTS']);
379+
$this->assertIsArray($result['ANNOUNCEMENTS']);
380380
$this->assertCount(2, $result['ANNOUNCEMENTS']);
381381
}
382382

tests/system/HTTP/RequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function testFetchGlobalReturnsArrayValues()
183183
$result = $this->request->fetchGlobal('post');
184184

185185
$this->assertEquals($post, $result);
186-
$this->assertInternalType('array', $result['ANNOUNCEMENTS']);
186+
$this->assertIsArray($result['ANNOUNCEMENTS']);
187187
$this->assertCount(2, $result['ANNOUNCEMENTS']);
188188
}
189189

tests/system/Helpers/TextHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public function testRandomString()
9999
$this->assertEquals(16, strlen(random_string('numeric', 16)));
100100
$this->assertEquals(8, strlen(random_string('numeric')));
101101

102-
$this->assertInternalType('string', random_string('basic'));
102+
$this->assertIsString(random_string('basic'));
103103
$this->assertEquals(16, strlen($random = random_string('crypto', 16)));
104-
$this->assertInternalType('string', $random);
104+
$this->assertIsString($random);
105105

106106
$this->assertEquals(32, strlen($random = random_string('md5')));
107107
$this->assertEquals(40, strlen($random = random_string('sha1')));

tests/system/Router/RouterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function testClosures()
171171

172172
$expects = $closure(...$router->params());
173173

174-
$this->assertInternalType('callable', $router->controllerName());
174+
$this->assertIsCallable($router->controllerName());
175175
$this->assertEquals($expects, '123-alpha');
176176
}
177177

0 commit comments

Comments
 (0)