Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests/HtmlElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,35 @@ function it_generates_elements_with_boolean_attributes()

$this->assertSame('<input required>', $element->render());
}

/** @test */
function it_generates_a_void_element_with_mixed_attributes()
{
$element = new HtmlElement(
'input',
['id' => 'my_paragraph', 'class' => 'paragraph', 'required'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although probably not very important, I'd change the name of the id and the class.

''
);

$this->assertSame(
'<input id="my_paragraph" class="paragraph" required>',
$element->render()
);
}

/** @test */
function it_generates_an_element_with_mixed_attributes()
{
$element = new HtmlElement(
'textarea',
['id' => 'disabled_paragraph', 'class' => 'paragraph', 'disabled'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

'Contenido'
);

$this->assertSame(
'<textarea id="disabled_paragraph" class="paragraph" disabled>Contenido</textarea>',
$element->render()
);
}

}