Commit 56dfd325 authored by Fabien Potencier's avatar Fabien Potencier

minor #1529 Added test of FormTrait::namedForm() (chihiro-adachi)

This PR was squashed before being merged into the 2.1.x-dev branch (closes #1529).

Discussion
----------

Added test of FormTrait::namedForm()

I did not see the test of FormTrait::namedForm(), so I created it.

Commits
-------

32640626 Added test of FormTrait::namedForm()
parents 8e187c12 32640626
......@@ -13,6 +13,7 @@ namespace Silex\Tests\Application;
use PHPUnit\Framework\TestCase;
use Silex\Provider\FormServiceProvider;
use Symfony\Component\Form\FormBuilder;
/**
* FormTrait test cases.
......@@ -23,7 +24,15 @@ class FormTraitTest extends TestCase
{
public function testForm()
{
$this->assertInstanceOf('Symfony\Component\Form\FormBuilder', $this->createApplication()->form());
$this->assertInstanceOf(FormBuilder::class, $this->createApplication()->form());
}
public function testNamedForm()
{
$builder = $this->createApplication()->namedForm('foo');
$this->assertInstanceOf(FormBuilder::class, $builder);
$this->assertSame('foo', $builder->getName());
}
public function createApplication()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment