Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Form] Added default
inputmode
attribute to Search, Email and Tel f…
…orm types
- Loading branch information
1 parent
8c80c5b
commit dbc500f
Showing
7 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Symfony/Component/Form/Tests/Extension/Core/Type/EmailTypeTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Extension\Core\Type; | ||
|
||
class EmailTypeTest extends BaseTypeTest | ||
{ | ||
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\EmailType'; | ||
|
||
public function testDefaultInputmode() | ||
{ | ||
$form = $this->factory->create(static::TESTED_TYPE); | ||
|
||
$this->assertSame('email', $form->createView()->vars['attr']['inputmode']); | ||
} | ||
|
||
public function testOverwrittenInputmode() | ||
{ | ||
$form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]); | ||
|
||
$this->assertSame('text', $form->createView()->vars['attr']['inputmode']); | ||
} | ||
|
||
public function testSubmitNull($expected = null, $norm = null, $view = null) | ||
{ | ||
parent::testSubmitNull($expected, $norm, ''); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Symfony/Component/Form/Tests/Extension/Core/Type/SearchTypeTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Extension\Core\Type; | ||
|
||
class SearchTypeTest extends BaseTypeTest | ||
{ | ||
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\SearchType'; | ||
|
||
public function testDefaultInputmode() | ||
{ | ||
$form = $this->factory->create(static::TESTED_TYPE); | ||
|
||
$this->assertSame('search', $form->createView()->vars['attr']['inputmode']); | ||
} | ||
|
||
public function testOverwrittenInputmode() | ||
{ | ||
$form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]); | ||
|
||
$this->assertSame('text', $form->createView()->vars['attr']['inputmode']); | ||
} | ||
|
||
public function testSubmitNull($expected = null, $norm = null, $view = null) | ||
{ | ||
parent::testSubmitNull($expected, $norm, ''); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Symfony/Component/Form/Tests/Extension/Core/Type/TelTypeTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Extension\Core\Type; | ||
|
||
class TelTypeTest extends BaseTypeTest | ||
{ | ||
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\TelType'; | ||
|
||
public function testDefaultInputmode() | ||
{ | ||
$form = $this->factory->create(static::TESTED_TYPE); | ||
|
||
$this->assertSame('tel', $form->createView()->vars['attr']['inputmode']); | ||
} | ||
|
||
public function testOverwrittenInputmode() | ||
{ | ||
$form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]); | ||
|
||
$this->assertSame('text', $form->createView()->vars['attr']['inputmode']); | ||
} | ||
|
||
public function testSubmitNull($expected = null, $norm = null, $view = null) | ||
{ | ||
parent::testSubmitNull($expected, $norm, ''); | ||
} | ||
} |