Code Duplication    Length = 13-13 lines in 4 locations

tests/JSONTextTest.php 4 locations

@@ 51-63 (lines=13) @@
48
        $this->assertEquals([], $field->getValueAsIterable());
49
    }
50
51
    public function testFirst_AsArray()
52
    {
53
        $field = JSONText\Fields\JSONText::create('MyJSON');
54
        $field->setValue($this->getFixture('array_simple'));
55
        $field->setReturnType('array');
56
        $this->assertEquals([0 => 'great wall'], $field->first());
57
58
        $field = JSONText\Fields\JSONText::create('MyJSON');
59
        $field->setValue($this->getFixture('empty'));
60
        $field->setReturnType('array');
61
        $this->assertInternalType('array', $field->first());
62
        $this->assertCount(0, $field->first());
63
    }
64
65
    public function testFirst_AsJson()
66
    {
@@ 65-77 (lines=13) @@
62
        $this->assertCount(0, $field->first());
63
    }
64
65
    public function testFirst_AsJson()
66
    {
67
        $field = JSONText\Fields\JSONText::create('MyJSON');
68
        $field->setValue($this->getFixture('array_simple'));
69
        $field->setReturnType('json');
70
        $this->assertEquals('["great wall"]', $field->first());
71
72
        $field = JSONText\Fields\JSONText::create('MyJSON');
73
        $field->setValue($this->getFixture('empty'));
74
        $field->setReturnType('json');
75
        $this->assertInternalType('string', $field->first());
76
        $this->assertEquals('[]', $field->first());
77
    }
78
79
    public function testLast_AsArray()
80
    {
@@ 79-91 (lines=13) @@
76
        $this->assertEquals('[]', $field->first());
77
    }
78
79
    public function testLast_AsArray()
80
    {
81
        $field = JSONText\Fields\JSONText::create('MyJSON');
82
        $field->setValue($this->getFixture('array_simple'));
83
        $field->setReturnType('array');
84
        $this->assertEquals([6 => 'morris'], $field->last());
85
86
        $field = JSONText\Fields\JSONText::create('MyJSON');
87
        $field->setValue($this->getFixture('empty'));
88
        $field->setReturnType('array');
89
        $this->assertInternalType('array', $field->first());
90
        $this->assertCount(0, $field->first());
91
    }
92
93
    public function testLast_AsJson()
94
    {
@@ 93-105 (lines=13) @@
90
        $this->assertCount(0, $field->first());
91
    }
92
93
    public function testLast_AsJson()
94
    {
95
        $field = JSONText\Fields\JSONText::create('MyJSON');
96
        $field->setValue($this->getFixture('array_simple'));
97
        $field->setReturnType('json');
98
        $this->assertEquals('{"6":"morris"}', $field->last());
99
100
        $field = JSONText\Fields\JSONText::create('MyJSON');
101
        $field->setValue($this->getFixture('empty'));
102
        $field->setReturnType('json');
103
        $this->assertInternalType('string', $field->first());
104
        $this->assertEquals('[]', $field->first());
105
    }
106
107
    public function testNth_AsArray()
108
    {