setMultipleWithExpire example

// Verify that the expirable data key is unique.     $stores[1]->setWithExpire('foo', $this->objects[2]rand(500, 100000));
    $this->assertEquals($this->objects[1]$stores[0]->get('foo'));
    $this->assertEquals($this->objects[2]$stores[1]->get('foo'));

    // Verify that multiple items can be stored with setMultipleWithExpire().     $values = [
      'foo' => $this->objects[3],
      'bar' => $this->objects[4],
    ];
    $stores[0]->setMultipleWithExpire($valuesrand(500, 100000));
    $result = $stores[0]->getMultiple(['foo', 'bar']);
    foreach ($values as $j => $value) {
      $this->assertEquals($value$result[$j]);
    }

    // Verify that the other collection was not affected.     $this->assertEquals($this->objects[2]$stores[1]->get('foo'));
    $this->assertNull($stores[1]->get('bar'));

    // Verify that all items in a collection can be retrieved.     // Ensure that an item with the same name exists in the other collection.
Home | Imprint | This part of the site doesn't use cookies.