The branch, master has been updated via 099be90fbafd84b0a427aed1c7f37d8f4e0d39ce (commit) via aec113c7b73a7f062cdf015fa24908b72a8180d1 (commit) from 0407bb70a9521fee3ec2fe9f301e11242b6e1ceb (commit)
- Log ----------------------------------------------------------------- commit 099be90fbafd84b0a427aed1c7f37d8f4e0d39ce Author: Michal Čihař michal@cihar.com Date: Mon Aug 15 10:38:09 2011 +0200
Add test for parsing
commit aec113c7b73a7f062cdf015fa24908b72a8180d1 Author: Michal Čihař michal@cihar.com Date: Mon Aug 15 10:36:01 2011 +0200
Rename file to match standards
-----------------------------------------------------------------------
Summary of changes: libraries/{advisor.class.php => Advisor.class.php} | 0 libraries/advisory_rules.txt | 2 +- scripts/advisor2php | 4 ++-- server_status.php | 2 +- test/classes/Advisor_test.php | 9 ++++++++- 5 files changed, 12 insertions(+), 5 deletions(-) rename libraries/{advisor.class.php => Advisor.class.php} (100%)
diff --git a/libraries/advisor.class.php b/libraries/Advisor.class.php similarity index 100% rename from libraries/advisor.class.php rename to libraries/Advisor.class.php diff --git a/libraries/advisory_rules.txt b/libraries/advisory_rules.txt index d50834c..f13f838 100644 --- a/libraries/advisory_rules.txt +++ b/libraries/advisory_rules.txt @@ -1,6 +1,6 @@ # phpMyAdmin Advisory rules file # Use only UNIX style newlines -# This file is being parsed by advisor.class.php, which should handle syntax errors correctly. +# This file is being parsed by Advisor.class.php, which should handle syntax errors correctly. # However, PHP Warnings and the like are being consumed by the phpMyAdmin error handler, so those won't show up # E.g.: Justification line is empty because you used an unescape percent sign, sprintf() returns an empty string and no warning/error is shown # diff --git a/scripts/advisor2php b/scripts/advisor2php index 7bc8567..c34f287 100644 --- a/scripts/advisor2php +++ b/scripts/advisor2php @@ -5,10 +5,10 @@ * by gettext for generating po(t) files. */
-if (!file_exists('./libraries/advisor.class.php')) { +if (!file_exists('./libraries/Advisor.class.php')) { chdir('..'); } -include './libraries/advisor.class.php'; +include './libraries/Advisor.class.php';
$rules = Advisor::parseRulesFile();
diff --git a/server_status.php b/server_status.php index e7d104b..1add0b6 100644 --- a/server_status.php +++ b/server_status.php @@ -357,7 +357,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { }
if(isset($_REQUEST['advisor'])) { - include('libraries/advisor.class.php'); + include('libraries/Advisor.class.php'); $advisor = new Advisor(); exit(json_encode($advisor->run())); } diff --git a/test/classes/Advisor_test.php b/test/classes/Advisor_test.php index 9bcba01..ac43516 100644 --- a/test/classes/Advisor_test.php +++ b/test/classes/Advisor_test.php @@ -9,7 +9,7 @@ /* * Include to test. */ -require_once 'libraries/advisor.class.php'; +require_once 'libraries/Advisor.class.php';
class Advisor_test extends PHPUnit_Framework_TestCase { @@ -29,5 +29,12 @@ class Advisor_test extends PHPUnit_Framework_TestCase array('%s% foo', '%s%% foo'), ); } + + public function testParse() + { + $advisor = new Advisor(); + $parseResult = $this->parseRulesFile(); + $this->assertEquals($parseResult['errors'], array()); + } } ?>
hooks/post-receive