Completed
Push — master ( a974e2...6a3284 )
by Alexandre
04:34
created

Tests/Application/Form/Type/TagTypeTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/*
4
 * This file is part of the Black package.
5
 *
6
 * (c) Alexandre 'pocky' Balmes <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tests\Black\Component\Common\Application\Form\Type;
13
14
use Black\Component\Common\Application\Form\Type\TagType;
15
use Symfony\Component\Form\Forms;
16
17
/**
18
 * Class TagTypeTest
19
 */
20
class TagTypeTest extends \PHPUnit_Framework_TestCase
21
{
22
    protected $factory;
23
24
    protected $prophet;
25
26
    public function testSubmitValidData()
27
    {
28
        $formData = 'test, test1';
29
30
        $type = new TagType('tag_type');
0 ignored issues
show
The call to TagType::__construct() has too many arguments starting with 'tag_type'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
31
        $form = $this->factory->create($type);
32
33
        $form->submit($formData);
34
35
        $this->assertEquals('tag_type', $form->getName());
36
        $this->assertTrue($form->isSynchronized());
37
        $this->assertEquals([0 => 'test', 1 => 'test1'], $form->getData());
38
    }
39
40
    protected function setUp()
41
    {
42
        $this->factory = Forms::createFormFactoryBuilder()->getFormFactory();
43
    }
44
}
45