4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Form\Tests\Extension\Core\Type
;
15 * @author Bernhard Schussek <bschussek@gmail.com>
17 class SubmitTypeTest
extends TypeTestCase
19 public function testCreateSubmitButtonInstances()
21 $this->assertInstanceOf('Symfony\Component\Form\SubmitButton', $this->factory
->create('submit'));
24 public function testNotClickedByDefault()
26 $button = $this->factory
->create('submit');
28 $this->assertFalse($button->isClicked());
31 public function testNotClickedIfSubmittedWithNull()
33 $button = $this->factory
->create('submit');
34 $button->submit(null);
36 $this->assertFalse($button->isClicked());
39 public function testClickedIfSubmittedWithEmptyString()
41 $button = $this->factory
->create('submit');
44 $this->assertTrue($button->isClicked());
47 public function testClickedIfSubmittedWithUnemptyString()
49 $button = $this->factory
->create('submit');
50 $button->submit('foo');
52 $this->assertTrue($button->isClicked());