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\Menu;
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\Menu;
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
        $menu = Menu::widget();
31
        $this->assertNotSame($menu, $menu->afterAttributes([]));
0 ignored issues
show
Bug introduced by
The method afterAttributes() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ afterAttributes([]));
Loading history...
32
        $this->assertNotSame($menu, $menu->afterClass(''));
0 ignored issues
show
Bug introduced by
The method afterClass() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ afterClass(''));
Loading history...
33
        $this->assertNotSame($menu, $menu->afterContent(''));
0 ignored issues
show
Bug introduced by
The method afterContent() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ afterContent(''));
Loading history...
34
        $this->assertNotSame($menu, $menu->afterTag(''));
0 ignored issues
show
Bug introduced by
The method afterTag() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ afterTag(''));
Loading history...
35
        $this->assertNotSame($menu, $menu->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

35
        $this->assertNotSame($menu, $menu->/** @scrutinizer ignore-call */ activeClass(''));
Loading history...
36
        $this->assertNotSame($menu, $menu->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

36
        $this->assertNotSame($menu, $menu->/** @scrutinizer ignore-call */ attributes([]));
Loading history...
37
        $this->assertNotSame($menu, $menu->beforeAttributes([]));
0 ignored issues
show
Bug introduced by
The method beforeAttributes() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ beforeAttributes([]));
Loading history...
38
        $this->assertNotSame($menu, $menu->beforeClass(''));
0 ignored issues
show
Bug introduced by
The method beforeClass() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ beforeClass(''));
Loading history...
39
        $this->assertNotSame($menu, $menu->beforeContent(''));
0 ignored issues
show
Bug introduced by
The method beforeContent() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ beforeContent(''));
Loading history...
40
        $this->assertNotSame($menu, $menu->beforeTag(''));
0 ignored issues
show
Bug introduced by
The method beforeTag() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ beforeTag(''));
Loading history...
41
        $this->assertNotSame($menu, $menu->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

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

42
        $this->assertNotSame($menu, $menu->/** @scrutinizer ignore-call */ container(false));
Loading history...
43
        $this->assertNotSame($menu, $menu->currentPath(''));
0 ignored issues
show
Bug introduced by
The method currentPath() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ currentPath(''));
Loading history...
44
        $this->assertNotSame($menu, $menu->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

44
        $this->assertNotSame($menu, $menu->/** @scrutinizer ignore-call */ disabledClass(''));
Loading history...
45
        $this->assertNotSame($menu, $menu->dropdownContainerClass(''));
0 ignored issues
show
Bug introduced by
The method dropdownContainerClass() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ dropdownContainerClass(''));
Loading history...
46
        $this->assertNotSame($menu, $menu->dropdownDefinitions([]));
0 ignored issues
show
Bug introduced by
The method dropdownDefinitions() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ dropdownDefinitions([]));
Loading history...
47
        $this->assertNotSame($menu, $menu->firstItemClass(''));
0 ignored issues
show
Bug introduced by
The method firstItemClass() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ firstItemClass(''));
Loading history...
48
        $this->assertNotSame($menu, $menu->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

48
        $this->assertNotSame($menu, $menu->/** @scrutinizer ignore-call */ iconContainerAttributes([]));
Loading history...
49
        $this->assertNotSame($menu, $menu->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($menu, $menu->/** @scrutinizer ignore-call */ items([]));
Loading history...
50
        $this->assertNotSame($menu, $menu->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($menu, $menu->/** @scrutinizer ignore-call */ itemsContainerAttributes([]));
Loading history...
51
        $this->assertNotSame($menu, $menu->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($menu, $menu->/** @scrutinizer ignore-call */ itemsContainerClass(''));
Loading history...
52
        $this->assertNotSame($menu, $menu->itemsTag(''));
0 ignored issues
show
Bug introduced by
The method itemsTag() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ itemsTag(''));
Loading history...
53
        $this->assertNotSame($menu, $menu->lastItemClass(''));
0 ignored issues
show
Bug introduced by
The method lastItemClass() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ lastItemClass(''));
Loading history...
54
        $this->assertNotSame($menu, $menu->linkAttributes([]));
0 ignored issues
show
Bug introduced by
The method linkAttributes() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ linkAttributes([]));
Loading history...
55
        $this->assertNotSame($menu, $menu->linkClass(''));
0 ignored issues
show
Bug introduced by
The method linkClass() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ linkClass(''));
Loading history...
56
        $this->assertNotSame($menu, $menu->linkTag(''));
0 ignored issues
show
Bug introduced by
The method linkTag() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ linkTag(''));
Loading history...
57
        $this->assertNotSame($menu, $menu->tagName(''));
0 ignored issues
show
Bug introduced by
The method tagName() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ tagName(''));
Loading history...
58
        $this->assertNotSame($menu, $menu->template(''));
0 ignored issues
show
Bug introduced by
The method template() 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. ( 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($menu, $menu->/** @scrutinizer ignore-call */ template(''));
Loading history...
59
    }
60
}
61