Пример #1
0
 public function testAddAttribute()
 {
     $tag = new Tag();
     $tag->disableAutoDump();
     $tag->addAttribute('test', 'value');
     $this->assertEquals('value', $tag->getAttribute('test'));
     $this->assertEquals(['test' => 'value', 'class' => []], $tag->getAttributes()->toArray());
     $tag->addAttributes(['test2' => 'value2', 'test' => 'value3']);
     $this->assertEquals('value3', $tag->getAttribute('test'));
     $this->assertEquals(['test' => 'value3', 'class' => [], 'test2' => 'value2'], $tag->getAttributes()->toArray());
 }