IssueFactoryTest::testCreate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 13
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 9.8333
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ChangelogGenerator\Tests;
6
7
use ChangelogGenerator\IssueFactory;
8
use PHPUnit\Framework\TestCase;
9
10
final class IssueFactoryTest extends TestCase
11
{
12
    private IssueFactory $issueFactory;
13
14
    public function testCreate(): void
15
    {
16
        $issue = $this->issueFactory->create([
17
            'number' => 1,
18
            'title' => '[Test] _ Title',
19
            'body' => 'Test Body',
20
            'html_url' => 'https://google.com',
21
            'user' => ['login' => 'jwage'],
22
            'labels' => [['name' => 'Enhancement']],
23
        ]);
24
25
        self::assertSame(1, $issue->getNumber());
26
        self::assertSame('&#91;Test&#93; &#95; Title', $issue->getTitle());
27
        self::assertSame('Test Body', $issue->getBody());
28
        self::assertSame('https://google.com', $issue->getUrl());
29
        self::assertSame('jwage', $issue->getUser());
30
        self::assertSame(['Enhancement'], $issue->getLabels());
31
    }
32
33
    protected function setUp(): void
34
    {
35
        $this->issueFactory = new IssueFactory();
36
    }
37
}
38