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('')); |
|
|
|
|
32
|
|
|
$this->assertNotSame($dropdown, $dropdown->container(false)); |
|
|
|
|
33
|
|
|
$this->assertNotSame($dropdown, $dropdown->containerAttributes([])); |
|
|
|
|
34
|
|
|
$this->assertNotSame($dropdown, $dropdown->containerClass('')); |
|
|
|
|
35
|
|
|
$this->assertNotSame($dropdown, $dropdown->containerTag('')); |
|
|
|
|
36
|
|
|
$this->assertNotSame($dropdown, $dropdown->disabledClass('')); |
|
|
|
|
37
|
|
|
$this->assertNotSame($dropdown, $dropdown->dividerAttributes([])); |
|
|
|
|
38
|
|
|
$this->assertNotSame($dropdown, $dropdown->dividerClass('')); |
|
|
|
|
39
|
|
|
$this->assertNotSame($dropdown, $dropdown->dividerTag('')); |
|
|
|
|
40
|
|
|
$this->assertNotSame($dropdown, $dropdown->headerClass('')); |
|
|
|
|
41
|
|
|
$this->assertNotSame($dropdown, $dropdown->headerTag('')); |
|
|
|
|
42
|
|
|
$this->assertNotSame($dropdown, $dropdown->id('')); |
|
|
|
|
43
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemClass('')); |
|
|
|
|
44
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemContainer(false)); |
|
|
|
|
45
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemContainerAttributes([])); |
|
|
|
|
46
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemContainerClass('')); |
|
|
|
|
47
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemContainerTag('')); |
|
|
|
|
48
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemTag('')); |
|
|
|
|
49
|
|
|
$this->assertNotSame($dropdown, $dropdown->items([])); |
|
|
|
|
50
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemsContainerAttributes([])); |
|
|
|
|
51
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemsContainerClass('')); |
|
|
|
|
52
|
|
|
$this->assertNotSame($dropdown, $dropdown->itemsContainerTag('')); |
|
|
|
|
53
|
|
|
$this->assertNotSame($dropdown, $dropdown->splitButtonAttributes([])); |
|
|
|
|
54
|
|
|
$this->assertNotSame($dropdown, $dropdown->splitButtonClass('')); |
|
|
|
|
55
|
|
|
$this->assertNotSame($dropdown, $dropdown->splitButtonSpanClass('')); |
|
|
|
|
56
|
|
|
$this->assertNotSame($dropdown, $dropdown->toggleAttributes([])); |
|
|
|
|
57
|
|
|
$this->assertNotSame($dropdown, $dropdown->toggleClass('')); |
|
|
|
|
58
|
|
|
$this->assertNotSame($dropdown, $dropdown->toggleType('')); |
|
|
|
|
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|