- Handles boolean attributes.
- Omits empty attributes if not forced by appending '!' to the name.
- JSON encodes array values
- Prettied output of class attribute and array data is handled.
public function testHattr() { $app = $this->getApp(); $handler = new AdminHandler($app); $attributes = ['class' => 'info-pop fa fa-info-circle', 'data-content' => ['gum', 'leaf'], 'data-title' => 'clippy', 'checked' => true, 'name+id' => 'koala']; $result = $handler->hattr($attributes); $this->assertSame(' class="info-pop fa fa-info-circle" data-content="["gum","leaf"]" data-title="clippy" checked name="koala" id="koala"', $result); }