8000 [Form] Add tel and color types by apetitpa · Pull Request #22679 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Add tel and color types #22679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add boostrap 3 layout tests for new types
  • Loading branch information
apetitpa committed Oct 2, 2017
commit bb0f3162155f30973db5e6c652ed46c8b10442d1
Original file line number Diff line number Diff line change
Expand Up @@ -2468,4 +2468,34 @@ public function testButtonAttributeNameRepeatedIfTrue()
// foo="foo"
$this->assertSame('<button type="button" id="button" name="button" foo="foo" class="btn-default btn">[trans]Button[/trans]</button>', $html);
}

public function testTel()
{
$tel = '0102030405';
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TelType', $tel);

$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
'/input
[@type="tel"]
[@name="name"]
[@class="my&class form-control"]
[@value="0102030405"]
'
);
}

public function testColor()
{
$color = '#0000ff';
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ColorType', $color);

$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
'/input
[@type="color"]
[@name="name"]
[@class="my&class form-control"]
[@value="#0000ff"]
'
);
}
}
0