Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

Commit 178cb75

Browse files
committed
Add initial test
1 parent c9b2cf1 commit 178cb75

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

infection.json.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
"mutators": {
1616
"@default": true
1717
},
18-
"bootstrap": "vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php"
18+
"bootstrap": "vendor/codeigniter4/framework/system/Test/bootstrap.php"
1919
}

tests/_support/ProjectTestCase.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php namespace Tests\Support;
2+
3+
use CodeIgniter\Test\CIUnitTestCase;
4+
5+
class ProjectTestCase extends CIUnitTestCase
6+
{
7+
}
8+

tests/misc/MybbTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
use App\Models\Mybb;
4+
use Tests\Support\ProjectTestCase;
5+
6+
class MybbTest extends ProjectTestCase
7+
{
8+
public function testUsesMock()
9+
{
10+
$temp = $_ENV['MOCK_MYBB'] ?? null;
11+
$_ENV['MOCK_MYBB'] = true;
12+
13+
$mybb = new Mybb();
14+
$result = $this->getPrivateProperty($mybb, 'mock');
15+
16+
$this->assertTrue($result);
17+
18+
$_ENV['MOCK_MYBB'] = $temp;
19+
}
20+
}

0 commit comments

Comments
 (0)