mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
more tests for Common functions
This commit is contained in:
parent
4cf13f4874
commit
4c5ddcae9d
@ -12,6 +12,7 @@ use Config\Logger;
|
||||
use CodeIgniter\Test\Mock\MockIncomingRequest;
|
||||
use CodeIgniter\Test\TestLogger;
|
||||
use CodeIgniter\Test\Mock\MockSession;
|
||||
use Tests\Support\Models\JobModel;
|
||||
|
||||
/**
|
||||
* @backupGlobals enabled
|
||||
@ -273,6 +274,18 @@ class CommonFunctionsTest extends \CodeIgniter\Test\CIUnitTestCase
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
public function testModelNotExists()
|
||||
{
|
||||
$this->assertNull(model(UnexsistenceClass::class));
|
||||
}
|
||||
|
||||
public function testModelExists()
|
||||
{
|
||||
$this->assertInstanceOf(JobModel::class, model(JobModel::class));
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
@ -405,4 +418,15 @@ class CommonFunctionsTest extends \CodeIgniter\Test\CIUnitTestCase
|
||||
$this->assertTrue($answer1->hasCookie('login_time'));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
public function testTrace()
|
||||
{
|
||||
ob_start();
|
||||
trace();
|
||||
$content = ob_get_clean();
|
||||
|
||||
$this->assertStringContainsString('Debug Backtrace', $content);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user