Code Duplication    Length = 17-18 lines in 2 locations

tests/Model/LogEntryTest.php 2 locations

@@ 63-79 (lines=17) @@
60
        static::assertEquals($expectedString, $result);
61
    }
62
63
    public function testFormatLegacyEntryEndArray()
64
    {
65
        $entry = 'E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied' .
66
            'for foreach()","file":"/data/site/docroot/logviewer/src/Model/LogEntry.php","line":89} []';
67
        $logEntry = LogEntry::create(array(
68
            'Level' => 'INFO',
69
            'Entry' => $entry
70
        ));
71
        $result = $this->invokeMethod($logEntry, 'formatLegacyEntry', array($entry));
72
        $expectedString = '<h2>Entry</h2>E_WARNING: Invalid argument supplied for foreach() => [<ul style="margin-bottom:' .
73
            ' 0"><li  class="list-unstyled"><span>code => 2</span></li><li  class="list-unstyled"><span>message =>' .
74
            ' Invalid argument suppliedfor foreach()</span></li><li  class="list-unstyled"><span>file =>' .
75
            ' /data/site/docroot/logviewer/src/Model/LogEntry.php</span></li><li  class="list-unstyled"><span>line' .
76
            " => 89</span></li></ul>]\n" .
77
            'Other => [<ul style="margin-bottom: 0"></ul>]';
78
        static::assertEquals($expectedString, $result);
79
    }
80
81
    public function testFormatLegacyEntryEndString()
82
    {
@@ 81-98 (lines=18) @@
78
        static::assertEquals($expectedString, $result);
79
    }
80
81
    public function testFormatLegacyEntryEndString()
82
    {
83
        $entry = 'E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied' .
84
            'for foreach()","file":"/data/site/docroot/logviewer/src/Model/LogEntry.php","line":89} OOPS';
85
        $logEntry = LogEntry::create(array(
86
            'Level' => 'INFO',
87
            'Entry' => $entry
88
        ));
89
90
        $result = $this->invokeMethod($logEntry, 'formatLegacyEntry', array($entry));
91
        $expectedString = '<h2>Entry</h2>E_WARNING: Invalid argument supplied for foreach() => [<ul style="margin-bottom:' .
92
            ' 0"><li  class="list-unstyled"><span>code => 2</span></li><li  class="list-unstyled"><span>message =>' .
93
            ' Invalid argument suppliedfor foreach()</span></li><li  class="list-unstyled"><span>file =>' .
94
            ' /data/site/docroot/logviewer/src/Model/LogEntry.php</span></li><li  class="list-unstyled"><span>line' .
95
            " => 89</span></li></ul>]\n" .
96
            "Other:\n OOPS";
97
        static::assertEquals($result, $expectedString);
98
    }
99
100
    /**
101
     * A literal field is returning null in getCMSFields.