Code Duplication    Length = 5-5 lines in 4 locations

core/SanityTests.php 4 locations

@@ 263-267 (lines=5) @@
260
     * test if zip is available
261
     */
262
    private function zip_test() {
263
        if (exec("which zip") != "") {
264
            $this->test_return(\core\common\Entity::L_OK, "<strong>zip</strong> binary found.");
265
        } else {
266
            $this->test_return(\core\common\Entity::L_ERROR, "<strong>zip</strong> not found in your \$PATH!");
267
        }
268
    }
269
270
    /**
@@ 277-281 (lines=5) @@
274
        exec(CONFIG_DIAGNOSTICS['PATHS']['eapol_test'], $out, $retval);
275
        if ($retval == 255) {
276
            $o = preg_grep('/-o<server cert/', $out);
277
            if (count($o) > 0) {
278
                $this->test_return(\core\common\Entity::L_OK, "<strong>eapol_test</strong> script found.");
279
            } else {
280
                $this->test_return(\core\common\Entity::L_ERROR, "<strong>eapol_test</strong> found, but is too old!");
281
            }
282
        } else {
283
            $this->test_return(\core\common\Entity::L_ERROR, "<strong>eapol_test</strong> not found!");
284
        }
@@ 531-535 (lines=5) @@
528
                $allthere .= $onelanguage['locale'] . " ";
529
            }
530
        }
531
        if ($allthere == "") {
532
            $this->test_return(\core\common\Entity::L_OK, "All of your configured locales are available on your system.");
533
        } else {
534
            $this->test_return(\core\common\Entity::L_WARN, "Some of your configured locales (<strong>$allthere</strong>) are not installed and will not be displayed correctly!");
535
        }
536
    }
537
538
    const DEFAULTS = [
@@ 615-619 (lines=5) @@
612
            }
613
        }
614
615
        if ($defaultvalues != "") {
616
            $this->test_return(\core\common\Entity::L_WARN, "Your configuration in config/config.php contains unchanged default values or links to inexistent files: <strong>$defaultvalues</strong>!");
617
        } else {
618
            $this->test_return(\core\common\Entity::L_OK, "Your configuration does not contain any unchanged defaults, which is a good sign.");
619
        }
620
    }
621
622
    /**