Completed
Push — master ( fcb59d...326ddf )
by Ruud
299:19 queued 288:03
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
use PHPUnit\Framework\TestCase;
8
9
/**
10
 * Tests for TextFormSubmissionField
11
 */
12 View Code Duplication
class TextFormSubmissionFieldTest extends TestCase
13
{
14
    /**
15
     * @var TextFormSubmissionField
16
     */
17
    protected $object;
18
19
    /**
20
     * Sets up the fixture, for example, opens a network connection.
21
     * This method is called before a test is executed.
22
     */
23
    protected function setUp()
24
    {
25
        $this->object = new TextFormSubmissionField();
26
    }
27
28
    /**
29
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::getValue
30
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::setValue
31
     */
32
    public function testGetSetValue()
33
    {
34
        $object = $this->object;
35
        $value = 'test';
36
        $object->setValue($value);
37
        $this->assertEquals($value, $object->getValue());
38
    }
39
40
    /**
41
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::getDefaultAdminType
42
     */
43
    public function testGetDefaultAdminType()
44
    {
45
        $this->assertEquals(TextFormSubmissionType::class, $this->object->getDefaultAdminType());
46
    }
47
48
    /**
49
     * @covers \Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes\TextFormSubmissionField::__toString
50
     */
51
    public function testToString()
52
    {
53
        $stringValue = $this->object->__toString();
54
        $this->assertNotNull($stringValue);
55
        $this->assertInternalType('string', $stringValue);
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit\Framework\Assert::assertInternalType() has been deprecated with message: https://github.com/sebastianbergmann/phpunit/issues/3369

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
56
    }
57
}
58