aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/tests/core/entities.php52
-rw-r--r--engine/tests/entities.php31
-rwxr-xr-xengine/tests/suite.php27
-rw-r--r--engine/tests/test_skeleton.php2
4 files changed, 69 insertions, 43 deletions
diff --git a/engine/tests/core/entities.php b/engine/tests/core/entities.php
new file mode 100644
index 000000000..e8013b1fc
--- /dev/null
+++ b/engine/tests/core/entities.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Elgg Test ElggEntities
+ *
+ * @package Elgg
+ * @subpackage Test
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+class ElggCoreEntityTest extends ElggCoreUnitTest {
+
+ /**
+ * Called before each test object.
+ */
+ public function __construct() {
+
+ }
+
+ /**
+ * Called before each test method.
+ */
+ public function setUp() {
+
+
+ }
+
+ /**
+ * Called after each test method.
+ */
+ public function tearDown() {
+
+
+ }
+
+ /**
+ * Called after each test object.
+ */
+ public function __destruct() {
+
+
+ }
+
+ /**
+ * A basic test that will be called and fail.
+ */
+ public function testElggEntityConstructor() {
+ $this->assertTrue(FALSE);
+ }
+}
+
+// ElggEntity is an abstract class with no abstact methods.
+class ElggEntityTest extends ElggEntity { }
diff --git a/engine/tests/entities.php b/engine/tests/entities.php
deleted file mode 100644
index efa8426dd..000000000
--- a/engine/tests/entities.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-
-class ElggCoreEntityTest extends ElggCoreUnitTest {
-
- public function __construct() {
-
- }
-
- public function setUp() {
-
-
- }
-
- public function tearDown() {
-
-
- }
-
- public funciton __destruct() {
-
-
- }
-
- public function testElggEntityConstructor() {
- $this->assertTrue(FALSE);
- }
-}
-
-// ElggEntity is an abstract class with no abstact methods.
-class ElggEntityTest extends ElggEntity { }
diff --git a/engine/tests/suite.php b/engine/tests/suite.php
index baf32481f..c8972a78f 100755
--- a/engine/tests/suite.php
+++ b/engine/tests/suite.php
@@ -9,17 +9,17 @@
*/
-require_once( dirname( __FILE__ ) . '/../start.php' );
+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" );
+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' );
+$suite = new TestSuite('Elgg Core Unit Tests');
// emit a hook to pull in all tests
$test_files = trigger_plugin_hook('unit_test', 'system', null, array());
@@ -27,10 +27,15 @@ foreach ($test_files as $file) {
$suite->addTestFile($file);
}
-if (!$CONFIG->debug) {
- if ( TextReporter::inCli() )
- {
- exit( $suite->Run( new TextReporter() ) ? 0 : 1 );
+// Only run tests in debug mode.
+if ($CONFIG->debug > 0) {
+ if (TextReporter::inCli()) {
+ // In CLI error codes are returned.
+ // 0 is success.
+ exit ($suite->Run(new TextReporter()) ? 0 : 1 );
}
- $suite->Run( new HtmlReporter() );
+ $suite->Run(new HtmlReporter());
+} else {
+ // @todo display an error?
+ exit (1);
}
diff --git a/engine/tests/test_skeleton.php b/engine/tests/test_skeleton.php
index 29dc01499..b958e7b25 100644
--- a/engine/tests/test_skeleton.php
+++ b/engine/tests/test_skeleton.php
@@ -35,7 +35,7 @@ class ElggCoreSkeletonTest extends ElggCoreUnitTest {
/**
* Called after each test object.
*/
- public funciton __destruct() {
+ public function __destruct() {
}