ImmutableTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testImmutable() 0 31 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Widgets\Tests\Dropdown;
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\Dropdown;
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
        $dropdown = Dropdown::widget();
31
        $this->assertNotSame($dropdown, $dropdown->activeClass(''));
0 ignored issues
show
Bug introduced by
The method activeClass() 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\Menu 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

31
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ activeClass(''));
Loading history...
32
        $this->assertNotSame($dropdown, $dropdown->container(false));
0 ignored issues
show
Bug introduced by
The method container() 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\Menu 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

32
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ container(false));
Loading history...
33
        $this->assertNotSame($dropdown, $dropdown->containerAttributes([]));
0 ignored issues
show
Bug introduced by
The method containerAttributes() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ containerAttributes([]));
Loading history...
34
        $this->assertNotSame($dropdown, $dropdown->containerClass(''));
0 ignored issues
show
Bug introduced by
The method containerClass() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ containerClass(''));
Loading history...
35
        $this->assertNotSame($dropdown, $dropdown->containerTag(''));
0 ignored issues
show
Bug introduced by
The method containerTag() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ containerTag(''));
Loading history...
36
        $this->assertNotSame($dropdown, $dropdown->disabledClass(''));
0 ignored issues
show
Bug introduced by
The method disabledClass() 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\Menu 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

36
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ disabledClass(''));
Loading history...
37
        $this->assertNotSame($dropdown, $dropdown->dividerAttributes([]));
0 ignored issues
show
Bug introduced by
The method dividerAttributes() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ dividerAttributes([]));
Loading history...
38
        $this->assertNotSame($dropdown, $dropdown->dividerClass(''));
0 ignored issues
show
Bug introduced by
The method dividerClass() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ dividerClass(''));
Loading history...
39
        $this->assertNotSame($dropdown, $dropdown->dividerTag(''));
0 ignored issues
show
Bug introduced by
The method dividerTag() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ dividerTag(''));
Loading history...
40
        $this->assertNotSame($dropdown, $dropdown->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

40
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ headerClass(''));
Loading history...
41
        $this->assertNotSame($dropdown, $dropdown->headerTag(''));
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

41
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ headerTag(''));
Loading history...
42
        $this->assertNotSame($dropdown, $dropdown->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

42
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ id(''));
Loading history...
43
        $this->assertNotSame($dropdown, $dropdown->itemClass(''));
0 ignored issues
show
Bug introduced by
The method itemClass() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemClass(''));
Loading history...
44
        $this->assertNotSame($dropdown, $dropdown->itemContainer(false));
0 ignored issues
show
Bug introduced by
The method itemContainer() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemContainer(false));
Loading history...
45
        $this->assertNotSame($dropdown, $dropdown->itemContainerAttributes([]));
0 ignored issues
show
Bug introduced by
The method itemContainerAttributes() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemContainerAttributes([]));
Loading history...
46
        $this->assertNotSame($dropdown, $dropdown->itemContainerClass(''));
0 ignored issues
show
Bug introduced by
The method itemContainerClass() 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\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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemContainerClass(''));
Loading history...
47
        $this->assertNotSame($dropdown, $dropdown->itemContainerTag(''));
0 ignored issues
show
Bug introduced by
The method itemContainerTag() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemContainerTag(''));
Loading history...
48
        $this->assertNotSame($dropdown, $dropdown->itemTag(''));
0 ignored issues
show
Bug introduced by
The method itemTag() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemTag(''));
Loading history...
49
        $this->assertNotSame($dropdown, $dropdown->items([]));
0 ignored issues
show
Bug introduced by
The method items() 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\Menu or Yiisoft\Yii\Widgets\Breadcrumbs 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

49
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ items([]));
Loading history...
50
        $this->assertNotSame($dropdown, $dropdown->itemsContainerAttributes([]));
0 ignored issues
show
Bug introduced by
The method itemsContainerAttributes() 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\Menu 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemsContainerAttributes([]));
Loading history...
51
        $this->assertNotSame($dropdown, $dropdown->itemsContainerClass(''));
0 ignored issues
show
Bug introduced by
The method itemsContainerClass() 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\Menu 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

51
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemsContainerClass(''));
Loading history...
52
        $this->assertNotSame($dropdown, $dropdown->itemsContainerTag(''));
0 ignored issues
show
Bug introduced by
The method itemsContainerTag() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ itemsContainerTag(''));
Loading history...
53
        $this->assertNotSame($dropdown, $dropdown->splitButtonAttributes([]));
0 ignored issues
show
Bug introduced by
The method splitButtonAttributes() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ splitButtonAttributes([]));
Loading history...
54
        $this->assertNotSame($dropdown, $dropdown->splitButtonClass(''));
0 ignored issues
show
Bug introduced by
The method splitButtonClass() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ splitButtonClass(''));
Loading history...
55
        $this->assertNotSame($dropdown, $dropdown->splitButtonSpanClass(''));
0 ignored issues
show
Bug introduced by
The method splitButtonSpanClass() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ splitButtonSpanClass(''));
Loading history...
56
        $this->assertNotSame($dropdown, $dropdown->toggleAttributes([]));
0 ignored issues
show
Bug introduced by
The method toggleAttributes() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ toggleAttributes([]));
Loading history...
57
        $this->assertNotSame($dropdown, $dropdown->toggleClass(''));
0 ignored issues
show
Bug introduced by
The method toggleClass() 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\Dropdown. ( 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($dropdown, $dropdown->/** @scrutinizer ignore-call */ toggleClass(''));
Loading history...
58
        $this->assertNotSame($dropdown, $dropdown->toggleType(''));
0 ignored issues
show
Bug introduced by
The method toggleType() 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\Dropdown. ( Ignorable by Annotation )

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

58
        $this->assertNotSame($dropdown, $dropdown->/** @scrutinizer ignore-call */ toggleType(''));
Loading history...
59
    }
60
}
61