Initial commit,修正

This commit is contained in:
2025-07-13 19:37:38 +08:00
parent 38ce288e27
commit 65bbd06981
12384 changed files with 3985464 additions and 8 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace tests\codeception\unit;
use tests\codeception\fixtures\AdminFixture;
/**
* Description of TestCase
*
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
* @since 1.0
*/
class TestCase extends \yii\codeception\TestCase
{
public $appConfig = '@tests/codeception/config/unit.php';
protected function setUp()
{
parent::setUp();
$this->loadFixtures();
}
public function fixtures()
{
return[
AdminFixture::className(),
];
}
}
+3
View File
@@ -0,0 +1,3 @@
<?php
// add unit testing specific bootstrap code here
@@ -0,0 +1,17 @@
<?php
namespace tests\codeception\unit\components;
/**
* Description of HelperTest
*
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
* @since 1.0
*/
class HelperTest extends \tests\codeception\unit\TestCase
{
public function testFilter()
{
$this->assertTrue(true);
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace tests\codeception\unit\models;
use Yii;
use tests\codeception\unit\TestCase;
use Codeception\Specify;
use mdm\admin\models\AuthItem;
class ItemTest extends TestCase
{
use Specify;
public function testAddNew()
{
$model = new AuthItem();
$model->attributes = [
'type' => 1,
];
// required
$this->assertFalse($model->validate());
$model = new AuthItem();
$model->attributes = [
'name' => 'Tester',
'type' => 1,
];
$this->assertTrue($model->validate());
$model->save();
$model = new AuthItem();
$model->attributes = [
'name' => 'Tester',
'type' => 1,
];
// not unique
$this->assertFalse($model->validate());
}
}
+19
View File
@@ -0,0 +1,19 @@
<?php
namespace tests\codeception\unit\models;
use tests\codeception\unit\TestCase;
/**
* Description of RouteTest
*
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
* @since 2.5
*/
class RouteTest extends TestCase
{
public function testGetRouteList()
{
$this->assertTrue(true);
}
}