From 716e8a83ad582240f02f8cff7cc2d064f4891401 Mon Sep 17 00:00:00 2001 From: webchick <webchick@24967.no-reply.drupal.org> Date: Wed, 10 Oct 2012 19:39:58 -0700 Subject: [PATCH] Issue #1808544 by xjm: Use a more easily recognized arbitrary integer in k/v expiration tests :). --- .../KeyValueStore/DatabaseStorageExpirableTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php index 2a4c7a7d803f..191989ef9b3d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageExpirableTest.php @@ -47,19 +47,19 @@ public function testCRUDWithExpiration() { // Verify that an item can be stored with setWithExpire(). // Use a random expiration in each test. - $stores[0]->setWithExpire('foo', $this->objects[0], rand(500, 299792458)); + $stores[0]->setWithExpire('foo', $this->objects[0], rand(500, 100000)); $this->assertIdenticalObject($this->objects[0], $stores[0]->get('foo')); // Verify that the other collection is not affected. $this->assertFalse($stores[1]->get('foo')); // Verify that an item can be updated with setWithExpire(). - $stores[0]->setWithExpire('foo', $this->objects[1], rand(500, 299792458)); + $stores[0]->setWithExpire('foo', $this->objects[1], rand(500, 100000)); $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo')); // Verify that the other collection is still not affected. $this->assertFalse($stores[1]->get('foo')); // Verify that the expirable data key is unique. - $stores[1]->setWithExpire('foo', $this->objects[2], rand(500, 299792458)); + $stores[1]->setWithExpire('foo', $this->objects[2], rand(500, 100000)); $this->assertIdenticalObject($this->objects[1], $stores[0]->get('foo')); $this->assertIdenticalObject($this->objects[2], $stores[1]->get('foo')); @@ -68,7 +68,7 @@ public function testCRUDWithExpiration() { 'foo' => $this->objects[3], 'bar' => $this->objects[4], ); - $stores[0]->setMultipleWithExpire($values, rand(500, 299792458)); + $stores[0]->setMultipleWithExpire($values, rand(500, 100000)); $result = $stores[0]->getMultiple(array('foo', 'bar')); foreach ($values as $j => $value) { $this->assertIdenticalObject($value, $result[$j]); @@ -104,7 +104,7 @@ public function testCRUDWithExpiration() { for ($i = 0; $i <= 1; $i++) { // setWithExpireIfNotExists() should be TRUE the first time (when $i is // 0) and FALSE the second time (when $i is 1). - $this->assertEqual(!$i, $stores[0]->setWithExpireIfNotExists($key, $this->objects[$i], rand(500, 299792458))); + $this->assertEqual(!$i, $stores[0]->setWithExpireIfNotExists($key, $this->objects[$i], rand(500, 100000))); $this->assertIdenticalObject($this->objects[0], $stores[0]->get($key)); // Verify that the other collection is not affected. $this->assertFalse($stores[1]->get($key)); @@ -112,7 +112,7 @@ public function testCRUDWithExpiration() { // Remove the item and try to set it again. $stores[0]->delete($key); - $stores[0]->setWithExpireIfNotExists($key, $this->objects[1], rand(500, 299792458)); + $stores[0]->setWithExpireIfNotExists($key, $this->objects[1], rand(500, 100000)); // This time it should succeed. $this->assertIdenticalObject($this->objects[1], $stores[0]->get($key)); // Verify that the other collection is still not affected. -- GitLab