From d48c65abbb6cdae43fac9838b0e5a3404e08b12a Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 25 Oct 2013 22:10:22 +0000 Subject: [PATCH] Complete lint testing for mPDF --- setup/test/tests/class.test.php | 2 +- setup/test/tests/test.syntax.php | 2 +- setup/test/tests/test.undefinedmethods.php | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/setup/test/tests/class.test.php b/setup/test/tests/class.test.php index 44842b3fe..a7f6c2fa0 100644 --- a/setup/test/tests/class.test.php +++ b/setup/test/tests/class.test.php @@ -14,7 +14,7 @@ class Test { '/setup/cli/stage/', '/include/plugins/', '/include/h2o/', - '/include/fpdf/', + '/include/mpdf/', ); function Test() { diff --git a/setup/test/tests/test.syntax.php b/setup/test/tests/test.syntax.php index 774ed964e..0adf1465a 100644 --- a/setup/test/tests/test.syntax.php +++ b/setup/test/tests/test.syntax.php @@ -6,7 +6,7 @@ class SyntaxTest extends Test { function testCompileErrors() { $exit = 0; - foreach ($this->getAllScripts() as $s) { + foreach ($this->getAllScripts(false) as $s) { ob_start(); system("php -l $s", $exit); $line = ob_get_contents(); diff --git a/setup/test/tests/test.undefinedmethods.php b/setup/test/tests/test.undefinedmethods.php index 2e06a452b..c767ba6ac 100644 --- a/setup/test/tests/test.undefinedmethods.php +++ b/setup/test/tests/test.undefinedmethods.php @@ -17,10 +17,14 @@ class UndefinedMethods extends Test { } foreach (find_function_calls($scripts) as $call) { list($file, $no, $line, $func) = $call; - if (!in_array($func, $function_defs)) - $this->fail($file, $no, "$func: Definitely undefined"); - else + if (!in_array($func, $function_defs)) { + // We don't ship all of mdpf, so a bit of it looks undefined + if (strpos($file, '/mpdf/') === false) + $this->fail($file, $no, "$func: Definitely undefined"); + } + else { $this->pass(); + } } } } -- GitLab