Code Duplication    Length = 10-17 lines in 2 locations

tests/FiltererTest.php 2 locations

@@ 486-502 (lines=17) @@
483
     * @test
484
     * @covers ::ofScalars
485
     */
486
    public function ofScalarsFail()
487
    {
488
        try {
489
            Filterer::ofScalars(['1', [], new \StdClass], [['string']]);
490
            $this->fail();
491
        } catch (Exception $e) {
492
            $expected = <<<TXT
493
Field '1' with value 'array (
494
)' failed filtering, message 'Value 'array (
495
)' is not a string'
496
Field '2' with value 'stdClass::__set_state(array(
497
))' failed filtering, message 'Value 'stdClass::__set_state(array(
498
))' is not a string'
499
TXT;
500
            $this->assertSame($expected, $e->getMessage());
501
        }
502
    }
503
504
    /**
505
     * @test
@@ 619-628 (lines=10) @@
616
     * @test
617
     * @covers ::ofArray
618
     */
619
    public function ofArrayUnknown()
620
    {
621
        try {
622
            Filterer::ofArray(['key' => '1'], ['key2' => [['uint']]]);
623
            $this->fail();
624
        } catch (Exception $e) {
625
            $expected = "Field 'key' with value '1' is unknown";
626
            $this->assertSame($expected, $e->getMessage());
627
        }
628
    }
629
}
630