diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-13 23:12:13 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-13 23:12:13 +0000 |
commit | 73a9dce4ebbccabb78cc50c9df3cd6150f182a21 (patch) | |
tree | 267883f057ccb74171b67b7a5a6c14bdf1956eec /engine/tests | |
parent | 7c3434d467308d128f665b4b855d8d293ee7852b (diff) | |
download | elgg-73a9dce4ebbccabb78cc50c9df3cd6150f182a21.tar.gz elgg-73a9dce4ebbccabb78cc50c9df3cd6150f182a21.tar.bz2 |
Swallowing all Elgg notices within unit tests.
By default, SimpleTest converts PHP errors into exceptions. This is restricted by adding a call to swallowErrors() within the tearDown() methods. This has also been noted within the unit test skeleton.
git-svn-id: http://code.elgg.org/elgg/trunk@3535 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests')
-rw-r--r-- | engine/tests/objects/entities.php | 1 | ||||
-rw-r--r-- | engine/tests/objects/objects.php | 4 | ||||
-rw-r--r-- | engine/tests/test_skeleton.php | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php index 0827fa24a..336e2f30d 100644 --- a/engine/tests/objects/entities.php +++ b/engine/tests/objects/entities.php @@ -19,6 +19,7 @@ class ElggCoreEntityTest extends ElggCoreUnitTest { * Called after each test method. */ public function tearDown() { + $this->swallowErrors(); unset($this->entity); } diff --git a/engine/tests/objects/objects.php b/engine/tests/objects/objects.php index de3c2f1c4..632ff4c38 100644 --- a/engine/tests/objects/objects.php +++ b/engine/tests/objects/objects.php @@ -27,6 +27,7 @@ class ElggCoreObjectTest extends ElggCoreUnitTest { * Called after each test method. */ public function tearDown() { + $this->swallowErrors(); unset($this->entity); } @@ -37,9 +38,6 @@ class ElggCoreObjectTest extends ElggCoreUnitTest { parent::__destruct(); } - /** - * A basic test that will be called and fail. - */ public function testElggObjectConstructor() { $attributes = array(); $attributes['guid'] = ''; diff --git a/engine/tests/test_skeleton.php b/engine/tests/test_skeleton.php index 42bbd4ba5..165ab0872 100644 --- a/engine/tests/test_skeleton.php +++ b/engine/tests/test_skeleton.php @@ -14,6 +14,8 @@ class ElggCoreSkeletonTest extends ElggCoreUnitTest { */ public function __construct() { parent::__construct(); + + // all code should come after here } /** @@ -27,13 +29,15 @@ class ElggCoreSkeletonTest extends ElggCoreUnitTest { * Called after each test method. */ public function tearDown() { - + // do not allow SimpleTest to interpret Elgg notices as exceptions + $this->swallowErrors(); } /** * Called after each test object. */ public function __destruct() { + // all code should go above here parent::__destruct(); } |