aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-02 18:40:04 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-02 18:40:04 +0000
commit322bb9cd2be9e51422cb2b82684692e825c2bfb7 (patch)
tree1e8e75c1ff0c47d6eda9db114a13dfa2b83adf72 /engine
parent4ffb02ad9c1b95013a0fbf97cefde827600ecc3f (diff)
downloadelgg-322bb9cd2be9e51422cb2b82684692e825c2bfb7.tar.gz
elgg-322bb9cd2be9e51422cb2b82684692e825c2bfb7.tar.bz2
Added simpletest and start of unit tests.
git-svn-id: http://code.elgg.org/elgg/trunk@3503 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rwxr-xr-xengine/tests/elgg_unit_test.php13
-rwxr-xr-xengine/tests/suite.php30
2 files changed, 43 insertions, 0 deletions
diff --git a/engine/tests/elgg_unit_test.php b/engine/tests/elgg_unit_test.php
new file mode 100755
index 000000000..79c3d375c
--- /dev/null
+++ b/engine/tests/elgg_unit_test.php
@@ -0,0 +1,13 @@
+<?php
+
+abstract class ElggCoreUnitTest extends UnitTestCase
+{
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function __destruct()
+ {
+ }
+}
diff --git a/engine/tests/suite.php b/engine/tests/suite.php
new file mode 100755
index 000000000..5eed796ac
--- /dev/null
+++ b/engine/tests/suite.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Runs unit tests.
+ *
+ * @package Elgg
+ * @subpackage Test
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+
+require_once( dirname( __FILE__ ) . '/../start.php' );
+
+$vendor_path = "$CONFIG->path/vendors/simpletest";
+$test_path = "$CONFIG->path/engine/tests";
+
+require_once( "$vendor_path/unit_tester.php" );
+require_once( "$vendor_path/mock_objects.php" );
+require_once( "$vendor_path/reporter.php" );
+require_once( "$test_path/elgg_unit_test.php" );
+
+$suite = new TestSuite( 'Elgg Core Unit Tests' );
+
+if (!$CONFIG->debug) {
+ if ( TextReporter::inCli() )
+ {
+ exit( $suite->Run( new TextReporter() ) ? 0 : 1 );
+ }
+ $suite->Run( new HtmlReporter() );
+}