* * 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:----wqtGHLPkoYDYaXR8gj1xkL0jsQEzPr9uPmFfZGuhu+lFntXgfBMojE1Ssy4xN0r63XLcHQNOhIsgpkaPKUzMneRfJkuX78poWuo/4pu3vn7/zSzXbaV2OyxQ/q6rBuEfEU3Gj0UPfqpcm2NIX8FC0HtqsvrrClk0H+D8himeI8bR8o6Tun0zRF7LCjCBLOS4QltQYT6Euo9Hmke8yDg4PAbXZKKwT+ePWLNrqnyS2Kvn+CPHaCqRveVUwsB4Bhg+c/bvo7h0bNiYfh0Kqf1kR+Tf/bDgBXjqIs/fILy8Q+hXiKVgdnIKehNATooNVHX9DF0M4XuHFGHsk0Em+aFovw6/ooNdLxQfPqCH05QuXKmK9UuADqJ9JomlH310mcUIp0RKqOsn+gu54u0xE0YYg0ensAeonoslSgsj89txFZU3J5kFbz6mS37ZRuLA/JGWFkTLuqYfIP1GoIGw2g8EJ0l/aWCuogYmcYy4t3QSvQDB4l4BuzC1ezZuSCQuORb/drxFFXNYtK/9hcrWtFpXDOK2mXH17Wh8946+XXyOi+NO5/9ur1g0uazhGiyws0+I/HIaJnmgNwIw7iqXYHiV1ulv0S5Z/r2b6KVr53mjw96+UtwTXMqL4MHjedJya96vYo7YYZQ0gydAiQ9dQeXVH8Wdz3cYyfIdD7R/7FakzQw=----ATTACHMENT:----ODc2OTYzOTkyNzc2Mjc2IDg4NzEyMDY4MzI4MTc3MjAgNTczNTk1MzM1MDUxMTQ2MQ==