mirror of
https://github.com/elyby/accounts.git
synced 2026-12-02 04:03:14 +05:30
Базовые модели перенесены в отдельное простраинство имён
Поправлены именования классов (хз, почему оно прежде работало)
This commit is contained in:
1 parent
e67257b8aa
commit
951b6928a2
12 files changed
+33
-26
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace tests\codeception\api\models\base;
|
||||
|
||||
use api\models\base\ApiForm;
|
||||
use Codeception\Specify;
|
||||
use tests\codeception\api\unit\TestCase;
|
||||
|
||||
class ApiFormTest extends TestCase {
|
||||
|
||||
use Specify;
|
||||
|
||||
public function testLoad() {
|
||||
$model = new DummyApiForm();
|
||||
$this->specify('model should load data without ModelName array scope', function () use ($model) {
|
||||
expect('model successful load data without prefix', $model->load(['field' => 'test-data']))->true();
|
||||
expect('field is set as passed data', $model->field)->equals('test-data');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class DummyApiForm extends ApiForm {
|
||||
|
||||
public $field;
|
||||
|
||||
public function rules() {
|
||||
return [
|
||||
['field', 'safe'],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user