* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Form\ButtonBuilder; use Symfony\Component\Form\Exception\InvalidArgumentException; /** * @author Alexander Cheprasov */ class ButtonBuilderTest extends TestCase { public function getValidNames() { return array( array('reset'), array('submit'), array('foo'), array('0'), array(0), array('button[]'), ); } /** * @dataProvider getValidNames */ public function testValidNames($name) { $this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder($name)); } public function getInvalidNames() { return array( array(''), array(false), array(null), ); } /** * @dataProvider getInvalidNames */ public function testInvalidNames($name) { if (method_exists($this, 'expectException')) { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Buttons cannot have empty names.'); } else { $this->setExpectedException(InvalidArgumentException::class, 'Buttons cannot have empty names.'); } new ButtonBuilder($name); } } __halt_compiler();----SIGNATURE:----TFPPnJGODyTrlQh0KRMN+QvpdNh2kFHVsbHt4t2eD1AdQBigGk9uq/sMCPAk/dKL18kBi5dKS1sjs+FpAbCeT0HZ3FgXmeH/Pp6WsKBqOtTdy/TvffxoZN3UXg4NuSZvpybIEibI2vbBTOl7Oxd9Jhm3KqyPamaQr0PWh4ywUVOhUFwTXwuMzLeqMejydYa2TwEtgLjGN54T2ulkkckdbY4VhtcOArwkPNKsWWU0g2qPy+yC4X5Z9R97rhKuCKLDZva2UDYQNen0RKkCcpP4uTbRl+xnAMRQ8zmG2ncl7XhUoLBfu58OVz9qflsH9tHZjaFalDB3LWFGMjWLoXoWEhlDEOtxPDIRrz7kPfg969VXwoDs2llkrZUxddKkd62QHtiSKre9uT2KZSGtweMfTYHxRZmCAlZoghmIpysNv4v6ByEIlNeO0tJckY3/Gdgm+4Zoqyp1TkDUnDtdf/TEl5EIEAKLsFyWHYKNvyN+7nrsl5iE3upnV0r3U+2sWS/bpmJ3yIVq4sEupkv0NWx53qQjqG3JOsfRxj9+cZr4isXkg0TlqClcm+gnGUvpFeTvpa7qa/5ZQ+l61zcN5lg2yrZX/VH3NTJQzq5oAaXSfjr2ze+NYU2OF8tWVigvg/U4vtW59hKe0/jUUHydU8PP9pnsapi6lZGto4fjKrAL6VA=----ATTACHMENT:----ODU1NjQ3Mzg4NTc3ODk2MiA4MDk2MDEyNjM0MDcxMDEwIDYyOTU5OTE1ODQ3MTQ3NzA=