示例#1
0
 public function testGetOrSetValue()
 {
     $provider = new BasicKeyDataProvider();
     $value = $this->key->getOrSetValue($provider)->data;
     $this->assertEquals(123, $value);
     $reply = $this->key->isExists();
     $this->assertTrue($reply);
     $this->assertEquals(123, $this->key->getValue());
     $value = $this->key->getOrSetValue($provider)->getOtherDataForTest();
     $this->assertEquals(123, $value);
     $this->key->delete();
     $value = $this->key->getOrSetValue($provider)->getData();
     $this->assertEquals(123, $value);
     $reply = $this->key->isExists();
     $this->assertTrue($reply);
     $this->assertEquals(123, $this->key->getValue());
     $getOrSetValueObject = $this->key->getOrSetValue($provider);
     $this->assertEquals(123, "{$getOrSetValueObject}");
 }
示例#2
0
 public function testGetOrSetValue()
 {
     require_once REDISKA_TESTS_PATH . '/classes/BasicKeyDataProvider.php';
     $provider = new BasicKeyDataProvider();
     $value = $this->key->getOrSetValue($provider)->data;
     $this->assertEquals(123, $value);
     $reply = $this->key->isExists();
     $this->assertTrue($reply);
     $this->assertEquals(123, $this->key->getValue());
     $value = $this->key->getOrSetValue($provider)->getOtherDataForTest();
     $this->assertEquals(123, $value);
     $this->key->delete();
     $value = $this->key->getOrSetValue($provider)->getData();
     $this->assertEquals(123, $value);
     $reply = $this->key->isExists();
     $this->assertTrue($reply);
     $this->assertEquals(123, $this->key->getValue());
     $getOrSetValueObject = $this->key->getOrSetValue($provider);
     $this->assertEquals(123, "{$getOrSetValueObject}");
 }