Рефакторинг api unit тестов

This commit is contained in:
ErickSkrauch
2016-10-29 00:47:31 +03:00
parent 7f2602fd29
commit 0e7013d9f5
29 changed files with 358 additions and 620 deletions

View File

@@ -2,19 +2,14 @@
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');
});
$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');
}
}