Passed
Pull Request — master (#1)
by James
01:31
created

ComparatorTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCompare() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace RoaveTest\ApiCompare;
5
6
use Roave\ApiCompare\Comparator;
7
use PHPUnit\Framework\TestCase;
8
use Roave\ApiCompare\Factory\DirectoryReflectorFactory;
9
10
/**
11
 * @covers \Roave\ApiCompare\Comparator
12
 */
13
final class ComparatorTest extends TestCase
14
{
15
    public function testCompare(): void
16
    {
17
        $reflectorFactory = new DirectoryReflectorFactory();
18
        self::assertSame(
19
            [
20
                '[BC] Parameter something in Thing::__construct has been deleted',
21
                '[BC] Method methodGone in class Thing has been deleted',
22
                '[BC] Class ClassGone has been deleted',
23
            ],
24
            (new Comparator())->compare(
25
                $reflectorFactory->__invoke(__DIR__ . '/../asset/api/old'),
26
                $reflectorFactory->__invoke(__DIR__ . '/../asset/api/new')
27
            )
28
        );
29
    }
30
}
31