From fe83e3d34320683e79191b08e1935ceb3364870c Mon Sep 17 00:00:00 2001 From: jgen Date: Mon, 17 Feb 2014 13:59:41 -0500 Subject: [PATCH] Adding comments to help explain the simpletest setup. --- .travis.yml | 2 ++ core/database.class.php | 1 + ext/simpletest/main.php | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1c463402..f7fcc449 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ before_script: - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi - if [[ "$DB" == "pgsql" ]]; then psql -c "create database shimmie;" -U postgres; fi - if [[ "$DB" == "mysql" ]]; then mysql -e "create database shimmie;" -uroot; fi + # shimmie needs to be able to create directories for images, etc. + # (permissions of 777 are bad, but it definitely works) - chmod -R 777 . script: php tests/simple_test.php -d $DB -u http://127.0.0.1/ diff --git a/core/database.class.php b/core/database.class.php index e7c4e27d..fc843cee 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -326,6 +326,7 @@ class Database { $this->connect_engine(); $this->engine->init($this->db); + // FIXME: this causes problems with running via the PHP CLI $this->db->beginTransaction(); } diff --git a/ext/simpletest/main.php b/ext/simpletest/main.php index e9d6903a..67b621f1 100644 --- a/ext/simpletest/main.php +++ b/ext/simpletest/main.php @@ -111,6 +111,8 @@ class SCoreWebTestCase extends WebTestCase { */ protected function get_page($page) { if($_SERVER['HTTP_HOST'] == "") { + // FIXME: this should be a command line option. + //print "http://127.0.0.1/2.Xm/index.php?q=$page"; $raw = $this->get("http://127.0.0.1/2.Xm/index.php?q=".str_replace("?", "&", $page)); } @@ -207,9 +209,15 @@ class ShimmieWebTestCase extends SCoreWebTestCase { class TestFinder extends TestSuite { function TestFinder($hint) { if(strpos($hint, "..") !== FALSE) return; + + // Select the test cases for "All" extensions. $dir = "{".ENABLED_EXTS."}"; + + // Unless the user specified just a specific extension. if(file_exists("ext/$hint/test.php")) $dir = $hint; + $this->TestSuite('All tests'); + foreach(zglob("ext/$dir/test.php") as $file) { $this->addFile($file); }