Initial commit,修正
This commit is contained in:
+42
@@ -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
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user