Completed
Push — master ( e1f0fb...216f84 )
by Sander
199:09 queued 186:30
created

TextFormSubmissionFieldTest.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
namespace Kunstmaan\FormBundle\Tests\Entity\FormSubmissionFieldTypes;
4
5
use Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField;
6
use Kunstmaan\FormBundle\Form\TextFormSubmissionType;
7
8
/**
9
 * Tests for TextFormSubmissionField
10
 */
11 View Code Duplication
class TextFormSubmissionFieldTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    /**
14
     * @var TextFormSubmissionField
15
     */
16
    protected $object;
17
18
    /**
19
     * Sets up the fixture, for example, opens a network connection.
20
     * This method is called before a test is executed.
21
     */
22
    protected function setUp()
23
    {
24
        $this->object = new TextFormSubmissionField();
25
    }
26
27
    /**
28
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::getValue
29
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::setValue
30
     */
31
    public function testGetSetValue()
32
    {
33
        $object = $this->object;
34
        $value = 'test';
35
        $object->setValue($value);
36
        $this->assertEquals($value, $object->getValue());
37
    }
38
39
    /**
40
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::getDefaultAdminType
41
     */
42
    public function testGetDefaultAdminType()
43
    {
44
        $this->assertEquals(TextFormSubmissionType::class, $this->object->getDefaultAdminType());
45
    }
46
47
    /**
48
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::__toString
49
     */
50
    public function testToString()
51
    {
52
        $stringValue = $this->object->__toString();
53
        $this->assertNotNull($stringValue);
54
        $this->assertTrue(is_string($stringValue));
55
    }
56
}
57