ImmutableTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testImmutable() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Widgets\Tests\ContentDecorator;
6
7
use PHPUnit\Framework\TestCase;
8
use Yiisoft\Definitions\Exception\CircularReferenceException;
9
use Yiisoft\Definitions\Exception\InvalidConfigException;
10
use Yiisoft\Definitions\Exception\NotInstantiableException;
11
use Yiisoft\Factory\NotFoundException;
12
use Yiisoft\Yii\Widgets\ContentDecorator;
13
use Yiisoft\Yii\Widgets\Tests\Support\TestTrait;
14
15
/**
16
 * @psalm-suppress PropertyNotSetInConstructor
17
 */
18
final class ImmutableTest extends TestCase
19
{
20
    use TestTrait;
21
22
    /**
23
     * @throws CircularReferenceException
24
     * @throws InvalidConfigException
25
     * @throws NotFoundException
26
     * @throws NotInstantiableException
27
     */
28
    public function testImmutable(): void
29
    {
30
        $contentDecorator = ContentDecorator::widget();
31
        $this->assertNotSame($contentDecorator, $contentDecorator->parameters([]));
0 ignored issues
show
Bug introduced by
The method parameters() does not exist on Yiisoft\Widget\Widget. It seems like you code against a sub-type of Yiisoft\Widget\Widget such as Yiisoft\Yii\Widgets\ContentDecorator. ( Ignorable by Annotation )

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

31
        $this->assertNotSame($contentDecorator, $contentDecorator->/** @scrutinizer ignore-call */ parameters([]));
Loading history...
32
        $this->assertNotSame($contentDecorator, $contentDecorator->viewFile(''));
0 ignored issues
show
Bug introduced by
The method viewFile() does not exist on Yiisoft\Widget\Widget. It seems like you code against a sub-type of Yiisoft\Widget\Widget such as Yiisoft\Yii\Widgets\ContentDecorator. ( Ignorable by Annotation )

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

32
        $this->assertNotSame($contentDecorator, $contentDecorator->/** @scrutinizer ignore-call */ viewFile(''));
Loading history...
33
    }
34
}
35