Rebuilding with CodeIgniter 4
This commit is contained in:
parent
e6dcc92267
commit
3bce4ad0ac
92 changed files with 7304 additions and 380 deletions
33
tests/unit/HealthTest.php
Normal file
33
tests/unit/HealthTest.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
class HealthTest extends \CodeIgniter\Test\CIUnitTestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function testIsDefinedAppPath()
|
||||
{
|
||||
$test = defined('APPPATH');
|
||||
|
||||
$this->assertTrue($test);
|
||||
}
|
||||
|
||||
public function testBaseUrlHasBeenSet()
|
||||
{
|
||||
$env = $config = false;
|
||||
|
||||
// First check in .env
|
||||
if (is_file(HOMEPATH . '.env'))
|
||||
{
|
||||
$env = (bool) preg_grep("/^app\.baseURL = './", file(HOMEPATH . '.env'));
|
||||
}
|
||||
|
||||
// Then check the actual config file
|
||||
$reader = new \Tests\Support\Libraries\ConfigReader();
|
||||
$config = ! empty($reader->baseUrl);
|
||||
|
||||
$this->assertTrue($env || $config);
|
||||
}
|
||||
}
|
Reference in a new issue