yiisoft /
yii-widgets
| 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
Loading history...
|
|||||
| 32 | $this->assertNotSame($alert, $alert->body('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 33 | $this->assertNotSame($alert, $alert->bodyAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 34 | $this->assertNotSame($alert, $alert->bodyClass('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 35 | $this->assertNotSame($alert, $alert->bodyTag()); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 36 | $this->assertNotSame($alert, $alert->bodyContainerAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 37 | $this->assertNotSame($alert, $alert->bodyContainer(false)); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 38 | $this->assertNotSame($alert, $alert->buttonAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 39 | $this->assertNotSame($alert, $alert->buttonClass('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 40 | $this->assertNotSame($alert, $alert->buttonLabel()); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 41 | $this->assertNotSame($alert, $alert->buttonOnClick('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 42 | $this->assertNotSame($alert, $alert->class('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 43 | $this->assertNotSame($alert, $alert->id('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 44 | $this->assertNotSame($alert, $alert->header('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 45 | $this->assertNotSame($alert, $alert->headerAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 46 | $this->assertNotSame($alert, $alert->headerClass('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 47 | $this->assertNotSame($alert, $alert->headerContainer(false)); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 48 | $this->assertNotSame($alert, $alert->headerContainerAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 49 | $this->assertNotSame($alert, $alert->headerContainerClass('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 50 | $this->assertNotSame($alert, $alert->headerTag('div')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 51 | $this->assertNotSame($alert, $alert->iconAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 52 | $this->assertNotSame($alert, $alert->iconClass('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 53 | $this->assertNotSame($alert, $alert->iconContainerAttributes([])); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 54 | $this->assertNotSame($alert, $alert->iconContainerClass('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 55 | $this->assertNotSame($alert, $alert->iconText('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 56 | $this->assertNotSame($alert, $alert->layoutBody('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 57 | $this->assertNotSame($alert, $alert->layoutHeader('')); |
||||
|
0 ignored issues
–
show
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
Loading history...
|
|||||
| 58 | } |
||||
| 59 | } |
||||
| 60 |