Code Duplication    Length = 10-17 lines in 2 locations

tests/Filter/ArraysTest.php 2 locations

@@ 142-158 (lines=17) @@
139
     * @test
140
     * @covers ::ofScalars
141
     */
142
    public function ofScalarsFail()
143
    {
144
        try {
145
            Arrays::ofScalars(['1', [], new \StdClass], [['string']]);
146
            $this->fail();
147
        } catch (Exception $e) {
148
            $expected = <<<TXT
149
Field '1' with value 'array (
150
)' failed filtering, message 'Value 'array (
151
)' is not a string'
152
Field '2' with value 'stdClass::__set_state(array(
153
))' failed filtering, message 'Value 'stdClass::__set_state(array(
154
))' is not a string'
155
TXT;
156
            $this->assertSame($expected, $e->getMessage());
157
        }
158
    }
159
160
    /**
161
     * @test
@@ 275-284 (lines=10) @@
272
     * @test
273
     * @covers ::ofArray
274
     */
275
    public function ofArrayUnknown()
276
    {
277
        try {
278
            Arrays::ofArray(['key' => '1'], ['key2' => [['uint']]]);
279
            $this->fail();
280
        } catch (Exception $e) {
281
            $expected = "Field 'key' with value '1' is unknown";
282
            $this->assertSame($expected, $e->getMessage());
283
        }
284
    }
285
286
    /**
287
     * Verifies the basic behavior of the flatten filter.