Adding comments to help explain the simpletest setup.
This commit is contained in:
		
							parent
							
								
									c05b4719d6
								
							
						
					
					
						commit
						fe83e3d343
					
				| @ -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 "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi | ||||||
|   - if [[ "$DB" == "pgsql" ]]; then psql -c "create database 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 |   - 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 . |   - chmod -R 777 . | ||||||
| 
 | 
 | ||||||
| script: php tests/simple_test.php -d $DB -u http://127.0.0.1/ | script: php tests/simple_test.php -d $DB -u http://127.0.0.1/ | ||||||
|  | |||||||
| @ -326,6 +326,7 @@ class Database { | |||||||
| 		$this->connect_engine(); | 		$this->connect_engine(); | ||||||
| 		$this->engine->init($this->db); | 		$this->engine->init($this->db); | ||||||
| 
 | 
 | ||||||
|  | 		// FIXME: this causes problems with running via the PHP CLI
 | ||||||
| 		$this->db->beginTransaction(); | 		$this->db->beginTransaction(); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -111,6 +111,8 @@ class SCoreWebTestCase extends WebTestCase { | |||||||
| 	 */ | 	 */ | ||||||
| 	protected function get_page($page) { | 	protected function get_page($page) { | ||||||
| 		if($_SERVER['HTTP_HOST'] == "<cli command>") { | 		if($_SERVER['HTTP_HOST'] == "<cli command>") { | ||||||
|  | 			// FIXME: this should be a command line option.
 | ||||||
|  | 			 | ||||||
| 			//print "http://127.0.0.1/2.Xm/index.php?q=$page";
 | 			//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)); | 			$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 { | class TestFinder extends TestSuite { | ||||||
| 	function TestFinder($hint) { | 	function TestFinder($hint) { | ||||||
| 		if(strpos($hint, "..") !== FALSE) return; | 		if(strpos($hint, "..") !== FALSE) return; | ||||||
|  | 		 | ||||||
|  | 		// Select the test cases for "All" extensions.
 | ||||||
| 		$dir = "{".ENABLED_EXTS."}"; | 		$dir = "{".ENABLED_EXTS."}"; | ||||||
|  | 		 | ||||||
|  | 		// Unless the user specified just a specific extension.
 | ||||||
| 		if(file_exists("ext/$hint/test.php")) $dir = $hint; | 		if(file_exists("ext/$hint/test.php")) $dir = $hint; | ||||||
|  | 		 | ||||||
| 		$this->TestSuite('All tests'); | 		$this->TestSuite('All tests'); | ||||||
|  | 		 | ||||||
| 		foreach(zglob("ext/$dir/test.php") as $file) { | 		foreach(zglob("ext/$dir/test.php") as $file) { | ||||||
| 			$this->addFile($file); | 			$this->addFile($file); | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user