Skip to content

Commit

Permalink
Merge pull request #2837 from samsonasik/more-test-common-functions
Browse files Browse the repository at this point in the history
more tests for Common functions
  • Loading branch information
lonnieezell authored Apr 17, 2020
2 parents 4cf13f4 + 4c5ddca commit 5750929
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/system/CommonFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use CodeIgniter\Test\Mock\MockIncomingRequest;
use CodeIgniter\Test\TestLogger;
use CodeIgniter\Test\Mock\MockSession;
use Tests\Support\Models\JobModel;

/**
* @backupGlobals enabled
Expand Down Expand Up @@ -273,6 +274,18 @@ public function testCSRFMeta()

// ------------------------------------------------------------------------

public function testModelNotExists()
{
$this->assertNull(model(UnexsistenceClass::class));
}

public function testModelExists()
{
$this->assertInstanceOf(JobModel::class, model(JobModel::class));
}

// ------------------------------------------------------------------------

/**
* @runInSeparateProcess
* @preserveGlobalState disabled
Expand Down Expand Up @@ -405,4 +418,15 @@ public function testRedirectResponseCookies1()
$this->assertTrue($answer1->hasCookie('login_time'));
}

//--------------------------------------------------------------------

public function testTrace()
{
ob_start();
trace();
$content = ob_get_clean();

$this->assertStringContainsString('Debug Backtrace', $content);
}

}

0 comments on commit 5750929

Please sign in to comment.