Completed
Push — master ( 156989...f20fb9 )
by Razon
02:28
created

ArticleMetaFactoryTest::dataCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
namespace App\Tests\Unit\Factory;
3
4
use App\Factory\ArticleMetaFactory;
5
use App\Model\ArticleMeta;
6
use Codeception\Test\Unit;
7
use Yii;
8
9
class ArticleMetaFactoryTest extends Unit
10
{
11
    /**
12
     * @dataProvider dataCreate
13
     */
14
    public function testCreate(int $articleId, string $content): void
15
    {
16
        $model = ArticleMetaFactory::create($articleId, $content);
17
        $this->assertSame($articleId, $model->article_id);
18
        $this->assertSame($content, $model->content);
19
    }
20
21
    public function dataCreate(): array
22
    {
23
        return [
24
            [1, 'foo'],
25
            [2, 'bar'],
26
        ];
27
    }
28
}
29