AggregateTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testVisitThrowsException() 0 8 1
A testAccept() 0 5 1
1
<?php declare(strict_types = 1);
2
3
namespace Apicart\FQL\Tests\Generator\Common;
4
5
use Apicart\FQL\Generator\Common\Aggregate;
6
use Apicart\FQL\Value\AbstractNode;
7
use PHPUnit\Framework\TestCase;
8
use RuntimeException;
9
10
final class AggregateTest extends TestCase
11
{
12
13
    public function testAccept(): void
14
    {
15
        /** @var AbstractNode $nodeMock */
16
        $nodeMock = $this->getMockBuilder(AbstractNode::class)->getMock();
17
        self::assertTrue((new Aggregate)->accept($nodeMock));
18
    }
19
20
21
    public function testVisitThrowsException(): void
22
    {
23
        self::expectException(RuntimeException::class);
0 ignored issues
show
Bug Best Practice introduced by
The method PHPUnit\Framework\TestCase::expectException() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        self::/** @scrutinizer ignore-call */ 
24
              expectException(RuntimeException::class);
Loading history...
24
        self::expectExceptionMessage('No visitor available for Mock');
0 ignored issues
show
Bug Best Practice introduced by
The method PHPUnit\Framework\TestCa...xpectExceptionMessage() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        self::/** @scrutinizer ignore-call */ 
25
              expectExceptionMessage('No visitor available for Mock');
Loading history...
25
26
        /** @var AbstractNode $nodeMock */
27
        $nodeMock = $this->getMockBuilder(AbstractNode::class)->getMock();
28
        (new Aggregate)->visit($nodeMock);
29
    }
30
31
}
32