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