예제 #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
파일: Basic.php 프로젝트: utachkin/Rediska
 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}");
 }