mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Rework tests structure. Upgrade codeception to 2.5.3. Merge params configuration into app configuration.
This commit is contained in:
27
api/tests/unit/models/base/ApiFormTest.php
Normal file
27
api/tests/unit/models/base/ApiFormTest.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace api\tests\_support\models\base;
|
||||
|
||||
use api\models\base\ApiForm;
|
||||
use api\tests\unit\TestCase;
|
||||
|
||||
class ApiFormTest extends TestCase {
|
||||
|
||||
public function testLoad() {
|
||||
$model = new DummyApiForm();
|
||||
$this->assertTrue($model->load(['field' => 'test-data']), 'model successful load data without prefix');
|
||||
$this->assertEquals('test-data', $model->field, 'field is set as passed data');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class DummyApiForm extends ApiForm {
|
||||
|
||||
public $field;
|
||||
|
||||
public function rules() {
|
||||
return [
|
||||
['field', 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user