ImmutableTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 30
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testImmutable() 0 30 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Widgets\Tests\Alert;
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\Alert;
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
        $alert = Alert::widget();
31
        $this->assertNotSame($alert, $alert->attributes([]));
0 ignored issues
show
Bug introduced by
The method attributes() 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\Alert or Yiisoft\Yii\Widgets\Menu or Yiisoft\Yii\Widgets\Breadcrumbs. ( 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($alert, $alert->/** @scrutinizer ignore-call */ attributes([]));
Loading history...
32
        $this->assertNotSame($alert, $alert->body(''));
0 ignored issues
show
Bug introduced by
The method body() 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\Alert. ( 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($alert, $alert->/** @scrutinizer ignore-call */ body(''));
Loading history...
33
        $this->assertNotSame($alert, $alert->bodyAttributes([]));
0 ignored issues
show
Bug introduced by
The method bodyAttributes() 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\Alert. ( Ignorable by Annotation )

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

33
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ bodyAttributes([]));
Loading history...
34
        $this->assertNotSame($alert, $alert->bodyClass(''));
0 ignored issues
show
Bug introduced by
The method bodyClass() 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\Alert. ( Ignorable by Annotation )

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

34
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ bodyClass(''));
Loading history...
35
        $this->assertNotSame($alert, $alert->bodyTag());
0 ignored issues
show
Bug introduced by
The method bodyTag() 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\Alert. ( Ignorable by Annotation )

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

35
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ bodyTag());
Loading history...
36
        $this->assertNotSame($alert, $alert->bodyContainerAttributes([]));
0 ignored issues
show
Bug introduced by
The method bodyContainerAttributes() 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\Alert. ( Ignorable by Annotation )

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

36
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ bodyContainerAttributes([]));
Loading history...
37
        $this->assertNotSame($alert, $alert->bodyContainer(false));
0 ignored issues
show
Bug introduced by
The method bodyContainer() 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\Alert. ( Ignorable by Annotation )

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

37
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ bodyContainer(false));
Loading history...
38
        $this->assertNotSame($alert, $alert->buttonAttributes([]));
0 ignored issues
show
Bug introduced by
The method buttonAttributes() 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\Alert. ( Ignorable by Annotation )

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

38
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ buttonAttributes([]));
Loading history...
39
        $this->assertNotSame($alert, $alert->buttonClass(''));
0 ignored issues
show
Bug introduced by
The method buttonClass() 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\Alert. ( Ignorable by Annotation )

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

39
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ buttonClass(''));
Loading history...
40
        $this->assertNotSame($alert, $alert->buttonLabel());
0 ignored issues
show
Bug introduced by
The method buttonLabel() 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\Alert. ( Ignorable by Annotation )

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

40
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ buttonLabel());
Loading history...
41
        $this->assertNotSame($alert, $alert->buttonOnClick(''));
0 ignored issues
show
Bug introduced by
The method buttonOnClick() 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\Alert. ( Ignorable by Annotation )

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

41
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ buttonOnClick(''));
Loading history...
42
        $this->assertNotSame($alert, $alert->class(''));
0 ignored issues
show
Bug introduced by
The method class() 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\Alert or Yiisoft\Yii\Widgets\Menu. ( Ignorable by Annotation )

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

42
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ class(''));
Loading history...
43
        $this->assertNotSame($alert, $alert->id(''));
0 ignored issues
show
Bug introduced by
The method id() does not exist on Yiisoft\Widget\Widget. It seems like you code against a sub-type of said class. However, the method does not exist in Yiisoft\Yii\Widgets\Menu or Yiisoft\Yii\Widgets\ContentDecorator or Yiisoft\Yii\Widgets\Breadcrumbs. Are you sure you never get one of those? ( Ignorable by Annotation )

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

43
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ id(''));
Loading history...
44
        $this->assertNotSame($alert, $alert->header(''));
0 ignored issues
show
Bug introduced by
The method header() 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\Alert. ( Ignorable by Annotation )

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

44
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ header(''));
Loading history...
45
        $this->assertNotSame($alert, $alert->headerAttributes([]));
0 ignored issues
show
Bug introduced by
The method headerAttributes() 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\Alert. ( Ignorable by Annotation )

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

45
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ headerAttributes([]));
Loading history...
46
        $this->assertNotSame($alert, $alert->headerClass(''));
0 ignored issues
show
Bug introduced by
The method headerClass() 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\Alert or Yiisoft\Yii\Widgets\Dropdown. ( Ignorable by Annotation )

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

46
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ headerClass(''));
Loading history...
47
        $this->assertNotSame($alert, $alert->headerContainer(false));
0 ignored issues
show
Bug introduced by
The method headerContainer() 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\Alert. ( Ignorable by Annotation )

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

47
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ headerContainer(false));
Loading history...
48
        $this->assertNotSame($alert, $alert->headerContainerAttributes([]));
0 ignored issues
show
Bug introduced by
The method headerContainerAttributes() 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\Alert. ( Ignorable by Annotation )

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

48
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ headerContainerAttributes([]));
Loading history...
49
        $this->assertNotSame($alert, $alert->headerContainerClass(''));
0 ignored issues
show
Bug introduced by
The method headerContainerClass() 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\Alert. ( Ignorable by Annotation )

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

49
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ headerContainerClass(''));
Loading history...
50
        $this->assertNotSame($alert, $alert->headerTag('div'));
0 ignored issues
show
Bug introduced by
The method headerTag() 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\Alert or Yiisoft\Yii\Widgets\Dropdown. ( Ignorable by Annotation )

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

50
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ headerTag('div'));
Loading history...
51
        $this->assertNotSame($alert, $alert->iconAttributes([]));
0 ignored issues
show
Bug introduced by
The method iconAttributes() 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\Alert. ( Ignorable by Annotation )

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

51
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ iconAttributes([]));
Loading history...
52
        $this->assertNotSame($alert, $alert->iconClass(''));
0 ignored issues
show
Bug introduced by
The method iconClass() 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\Alert. ( Ignorable by Annotation )

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

52
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ iconClass(''));
Loading history...
53
        $this->assertNotSame($alert, $alert->iconContainerAttributes([]));
0 ignored issues
show
Bug introduced by
The method iconContainerAttributes() 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\Alert or Yiisoft\Yii\Widgets\Menu. ( Ignorable by Annotation )

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

53
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ iconContainerAttributes([]));
Loading history...
54
        $this->assertNotSame($alert, $alert->iconContainerClass(''));
0 ignored issues
show
Bug introduced by
The method iconContainerClass() 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\Alert. ( Ignorable by Annotation )

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

54
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ iconContainerClass(''));
Loading history...
55
        $this->assertNotSame($alert, $alert->iconText(''));
0 ignored issues
show
Bug introduced by
The method iconText() 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\Alert. ( Ignorable by Annotation )

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

55
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ iconText(''));
Loading history...
56
        $this->assertNotSame($alert, $alert->layoutBody(''));
0 ignored issues
show
Bug introduced by
The method layoutBody() 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\Alert. ( Ignorable by Annotation )

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

56
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ layoutBody(''));
Loading history...
57
        $this->assertNotSame($alert, $alert->layoutHeader(''));
0 ignored issues
show
Bug introduced by
The method layoutHeader() 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\Alert. ( Ignorable by Annotation )

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

57
        $this->assertNotSame($alert, $alert->/** @scrutinizer ignore-call */ layoutHeader(''));
Loading history...
58
    }
59
}
60