コード例 #1
0
 /**
  * Make sure that keys are trimmed when we forget the value.
  */
 public function testTrimKeyWhenForgeting()
 {
     $this->memories->set('       A couple of spaces    ', 123);
     $this->assertEquals(123, $this->memories->get(' A couple of spaces '));
     $this->memories->forget('       A couple of spaces           ');
     $this->assertNull($this->memories->get('A couple of spaces'));
 }
コード例 #2
0
 /**
  * Test if we get correct default value if value field is empty for some reason (unserliaze() would return false).
  */
 public function testDefaultValueWhenUnserializationFails()
 {
     $this->link->query('INSERT INTO `' . MySQLAdapter::TABLE_NAME . '` (`key`, `value`, `updated_on`) VALUES ("Key", "", UTC_TIMESTAMP)');
     $this->assertSame(123, $this->memories->get('Key', 123));
 }