aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/api/helpers.php
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-06-08 21:34:11 -0400
committerSteve Clay <steve@mrclay.org>2013-06-08 21:34:11 -0400
commit8a47b2342e53c9cdf3093982486b19d6cc2f3e9b (patch)
tree38580c9ead3830e100da483f4e21d9198b9f8bc3 /engine/tests/api/helpers.php
parent3a3a520958e1eb31ac9d20e7cb818d8c3b5fff4a (diff)
downloadelgg-8a47b2342e53c9cdf3093982486b19d6cc2f3e9b.tar.gz
elgg-8a47b2342e53c9cdf3093982486b19d6cc2f3e9b.tar.bz2
Improved algorithm by tracking total incomplete entities
Diffstat (limited to 'engine/tests/api/helpers.php')
-rw-r--r--engine/tests/api/helpers.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/engine/tests/api/helpers.php b/engine/tests/api/helpers.php
index 06ef55138..10216140f 100644
--- a/engine/tests/api/helpers.php
+++ b/engine/tests/api/helpers.php
@@ -579,7 +579,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
public function testElggBatchReadHandlesBrokenEntities() {
- $num_test_entities = 6;
+ $num_test_entities = 8;
$guids = array();
for ($i = $num_test_entities; $i > 0; $i--) {
$entity = new ElggObject();
@@ -592,11 +592,11 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
// break entities such that the first fetch has one incomplete
- // and the second fetch has only incompletes!
+ // and the second and third fetches have only incompletes!
$db_prefix = elgg_get_config('dbprefix');
delete_data("
DELETE FROM {$db_prefix}objects_entity
- WHERE guid IN ({$guids[1]}, {$guids[2]}, {$guids[3]})
+ WHERE guid IN ({$guids[1]}, {$guids[2]}, {$guids[3]}, {$guids[4]}, {$guids[5]})
");
$options = array(
@@ -613,7 +613,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
// The broken entities should not have been visited
- $this->assertEqual($entities_visited, array($guids[0], $guids[4], $guids[5]));
+ $this->assertEqual($entities_visited, array($guids[0], $guids[6], $guids[7]));
// cleanup (including leftovers from previous tests)
$entity_rows = elgg_get_entities(array_merge($options, array(
@@ -629,7 +629,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
public function testElggBatchDeleteHandlesBrokenEntities() {
- $num_test_entities = 6;
+ $num_test_entities = 8;
$guids = array();
for ($i = $num_test_entities; $i > 0; $i--) {
$entity = new ElggObject();
@@ -642,11 +642,11 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
// break entities such that the first fetch has one incomplete
- // and the second fetch has only incompletes!
+ // and the second and third fetches have only incompletes!
$db_prefix = elgg_get_config('dbprefix');
delete_data("
DELETE FROM {$db_prefix}objects_entity
- WHERE guid IN ({$guids[1]}, {$guids[2]}, {$guids[3]})
+ WHERE guid IN ({$guids[1]}, {$guids[2]}, {$guids[3]}, {$guids[4]}, {$guids[5]})
");
$options = array(
@@ -664,7 +664,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
// The broken entities should not have been visited
- $this->assertEqual($entities_visited, array($guids[0], $guids[4], $guids[5]));
+ $this->assertEqual($entities_visited, array($guids[0], $guids[6], $guids[7]));
// cleanup (including leftovers from previous tests)
$entity_rows = elgg_get_entities(array_merge($options, array(