Skip to content

Commit 7ab250e

Browse files
committed
refactor: by rector
1 parent 11ab1be commit 7ab250e

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

tests/_support/Fakers/MonsterFaker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public function fake(Generator &$faker): Monster
2323
{
2424
return new Monster([
2525
'name' => $faker->lastName(),
26-
'health' => mt_rand(1, 50),
26+
'health' => random_int(1, 50),
2727

2828
/**
2929
* This is a special function of Fabricator that means "get how many items
3030
* have been generated for this table so far". It is handy for faking
3131
* related items, like the number of possible dungeons. But if none have
3232
* been made we will just pick a number.
3333
*/
34-
'dungeon_id' => mt_rand(1, Fabricator::getCount('dungeons') ?: 3),
34+
'dungeon_id' => random_int(1, Fabricator::getCount('dungeons') ?: 3),
3535
]);
3636
}
3737
}

tests/_support/Libraries/ConfigReader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@
3838

3939
namespace Tests\Support\Libraries;
4040

41+
use Config\App;
42+
4143
/**
4244
* Class ConfigReader
4345
*
4446
* An extension of BaseConfig that prevents the constructor from
4547
* loading external values. Used to read actual local values from
4648
* a config file.
4749
*/
48-
class ConfigReader extends \Config\App
50+
class ConfigReader extends App
4951
{
5052
public function __construct()
5153
{

tests/unit/HealthTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22

3+
use CodeIgniter\Test\CIUnitTestCase;
4+
use Tests\Support\Libraries\ConfigReader;
5+
36
/**
47
* @internal
58
*/
6-
final class HealthTest extends \CodeIgniter\Test\CIUnitTestCase
9+
final class HealthTest extends CIUnitTestCase
710
{
811
protected function setUp(): void
912
{
@@ -31,7 +34,7 @@ public function testBaseUrlHasBeenSet()
3134
}
3235

3336
// Then check the actual config file
34-
$reader = new \Tests\Support\Libraries\ConfigReader();
37+
$reader = new ConfigReader();
3538
$config = ! empty($reader->baseUrl);
3639

3740
$this->assertTrue($env || $config);

0 commit comments

Comments
 (0)