* * 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:----IQqcKK/tZ0KHZYQuLjd+Jrnx62dQoKIvlJvxik/3V5ywvQWGBkHqqxCyn6KJs9HQJ32MS3MwzkyP3BRkbOeqNCm7obGthyAT/hKKIs8d1y47ADZziXumeuqUDVeItvd/VI2yuf8fTxhFVDl6XoBd2a+dakP0YS++8/c64APRbYYl6mL4yGE0I562kkqbZLOyh9cZAl3azGn86aCEhhedn5DlzyjI4W6nUGqiMFjAiUxuVfnL140/9qUQ8/U0VzEe1EeJDFMYgnGJwdmfxhvXYdAQAPbM+e78aC5ge8VlxfUlB4FAO24HDxmRks1wPhoA7n1odeRtKCM9yjeWKhLEB1WZl7a+tsMXWXfY9vfQbjNDYygl8CJwVhQcFcyrNZkjcbLu5ljkI4pj5QWgi7ccMbhuVjVIwOYNzXTzNt+YOPbgSwmoI27eQ2CbjtCDu+S5B5/z1Q8S6MaXBGGsAlWb+kEWltPbgeP5j6xB2CAts6qjbqmqGdfVzqVd2ZXSfOcfZ3st0qJQk8rW/F8EdNMRi6qiSAdUQtY0i6joydRCO50/OILJK4zxNMgRBERsuGGquVHZZdTc1uvu0h/YCxBmNFYdbiItuPq10IKcR/cUlRVOGhlYvcl5k20o7Ve0+b9Ks64NoM9ExPe29NFv1fV8ugRVnFfqrSYG5bBGyANaT/g=----ATTACHMENT:----Mjk3NzMyNzI0MDY2MTg5NCA2NzY0MjE2NTM2OTA1MjU3IDE0OTE5ODc0MzU5MTYzMDE=