Completed
Push — master ( fcb59d...326ddf )
by Ruud
299:19 queued 288:03
created

TextFormSubmissionFieldTest::testToString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
0 ignored issues
show
Duplication introduced by
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...
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