| Conditions | 2 |
| Paths | 2 |
| Total Lines | 91 |
| Code Lines | 60 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 58 | public function testSyntaxHighlighterScriptFunction() { |
||
| 59 | |||
| 60 | $obj = new SyntaxHighlighterTwigExtension(getcwd()); |
||
| 61 | |||
| 62 | try { |
||
| 63 | $obj->syntaxHighlighterScriptFunction("exception"); |
||
| 64 | } catch (Exception $ex) { |
||
| 65 | $this->assertInstanceOf(FileNotFoundException::class, $ex); |
||
| 66 | $this->assertEquals("The file \"syntaxhighlighter-3.0.83/scripts/exception.js\" is not found", $ex->getMessage()); |
||
| 67 | } |
||
| 68 | |||
| 69 | $res1 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shCore.js\" type=\"text/javascript\"></script>"; |
||
| 70 | $this->assertEquals($res1, $obj->syntaxHighlighterScriptFunction("shCore")); |
||
| 71 | |||
| 72 | $res2 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shLegacy.js\" type=\"text/javascript\"></script>"; |
||
| 73 | $this->assertEquals($res2, $obj->syntaxHighlighterScriptFunction("shLegacy")); |
||
| 74 | |||
| 75 | $res3 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/XRegExp.js\" type=\"text/javascript\"></script>"; |
||
| 76 | $this->assertEquals($res3, $obj->syntaxHighlighterScriptFunction("XRegExp")); |
||
| 77 | |||
| 78 | $resB1 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushAS3.js\" type=\"text/javascript\"></script>"; |
||
| 79 | $this->assertEquals($resB1, $obj->syntaxHighlighterScriptFunction("shBrushAS3")); |
||
| 80 | |||
| 81 | $resB2 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushAppleScript.js\" type=\"text/javascript\"></script>"; |
||
| 82 | $this->assertEquals($resB2, $obj->syntaxHighlighterScriptFunction("shBrushAppleScript")); |
||
| 83 | |||
| 84 | $resB3 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushBash.js\" type=\"text/javascript\"></script>"; |
||
| 85 | $this->assertEquals($resB3, $obj->syntaxHighlighterScriptFunction("shBrushBash")); |
||
| 86 | |||
| 87 | $resB4 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushCSharp.js\" type=\"text/javascript\"></script>"; |
||
| 88 | $this->assertEquals($resB4, $obj->syntaxHighlighterScriptFunction("shBrushCSharp")); |
||
| 89 | |||
| 90 | $resB5 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushColdFusion.js\" type=\"text/javascript\"></script>"; |
||
| 91 | $this->assertEquals($resB5, $obj->syntaxHighlighterScriptFunction("shBrushColdFusion")); |
||
| 92 | |||
| 93 | $resB6 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushCpp.js\" type=\"text/javascript\"></script>"; |
||
| 94 | $this->assertEquals($resB6, $obj->syntaxHighlighterScriptFunction("shBrushCpp")); |
||
| 95 | |||
| 96 | $resB7 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushCss.js\" type=\"text/javascript\"></script>"; |
||
| 97 | $this->assertEquals($resB7, $obj->syntaxHighlighterScriptFunction("shBrushCss")); |
||
| 98 | |||
| 99 | $resB8 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushDelphi.js\" type=\"text/javascript\"></script>"; |
||
| 100 | $this->assertEquals($resB8, $obj->syntaxHighlighterScriptFunction("shBrushDelphi")); |
||
| 101 | |||
| 102 | $resB9 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushDiff.js\" type=\"text/javascript\"></script>"; |
||
| 103 | $this->assertEquals($resB9, $obj->syntaxHighlighterScriptFunction("shBrushDiff")); |
||
| 104 | |||
| 105 | $resB10 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushErlang.js\" type=\"text/javascript\"></script>"; |
||
| 106 | $this->assertEquals($resB10, $obj->syntaxHighlighterScriptFunction("shBrushErlang")); |
||
| 107 | |||
| 108 | $resB11 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushGroovy.js\" type=\"text/javascript\"></script>"; |
||
| 109 | $this->assertEquals($resB11, $obj->syntaxHighlighterScriptFunction("shBrushGroovy")); |
||
| 110 | |||
| 111 | $resB12 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushJScript.js\" type=\"text/javascript\"></script>"; |
||
| 112 | $this->assertEquals($resB12, $obj->syntaxHighlighterScriptFunction("shBrushJScript")); |
||
| 113 | |||
| 114 | $resB13 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushJava.js\" type=\"text/javascript\"></script>"; |
||
| 115 | $this->assertEquals($resB13, $obj->syntaxHighlighterScriptFunction("shBrushJava")); |
||
| 116 | |||
| 117 | $resB14 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushJavaFX.js\" type=\"text/javascript\"></script>"; |
||
| 118 | $this->assertEquals($resB14, $obj->syntaxHighlighterScriptFunction("shBrushJavaFX")); |
||
| 119 | |||
| 120 | $resB15 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushPerl.js\" type=\"text/javascript\"></script>"; |
||
| 121 | $this->assertEquals($resB15, $obj->syntaxHighlighterScriptFunction("shBrushPerl")); |
||
| 122 | |||
| 123 | $resB16 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushPhp.js\" type=\"text/javascript\"></script>"; |
||
| 124 | $this->assertEquals($resB16, $obj->syntaxHighlighterScriptFunction("shBrushPhp")); |
||
| 125 | |||
| 126 | $resB17 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushPlain.js\" type=\"text/javascript\"></script>"; |
||
| 127 | $this->assertEquals($resB17, $obj->syntaxHighlighterScriptFunction("shBrushPlain")); |
||
| 128 | |||
| 129 | $resB18 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushPowerShell.js\" type=\"text/javascript\"></script>"; |
||
| 130 | $this->assertEquals($resB18, $obj->syntaxHighlighterScriptFunction("shBrushPowerShell")); |
||
| 131 | |||
| 132 | $resB19 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushPython.js\" type=\"text/javascript\"></script>"; |
||
| 133 | $this->assertEquals($resB19, $obj->syntaxHighlighterScriptFunction("shBrushPython")); |
||
| 134 | |||
| 135 | $resB20 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushRuby.js\" type=\"text/javascript\"></script>"; |
||
| 136 | $this->assertEquals($resB20, $obj->syntaxHighlighterScriptFunction("shBrushRuby")); |
||
| 137 | |||
| 138 | $resB21 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushSass.js\" type=\"text/javascript\"></script>"; |
||
| 139 | $this->assertEquals($resB21, $obj->syntaxHighlighterScriptFunction("shBrushSass")); |
||
| 140 | |||
| 141 | $resB22 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushScala.js\" type=\"text/javascript\"></script>"; |
||
| 142 | $this->assertEquals($resB22, $obj->syntaxHighlighterScriptFunction("shBrushScala")); |
||
| 143 | |||
| 144 | $resB23 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushSql.js\" type=\"text/javascript\"></script>"; |
||
| 145 | $this->assertEquals($resB23, $obj->syntaxHighlighterScriptFunction("shBrushSql")); |
||
| 146 | |||
| 147 | $resB24 = "<script src=\"/bundles/syntaxhighlighter/syntaxhighlighter-3.0.83/scripts/shBrushXml.js\" type=\"text/javascript\"></script>"; |
||
| 148 | $this->assertEquals($resB24, $obj->syntaxHighlighterScriptFunction("shBrushXml")); |
||
| 149 | } |
||
| 220 |