/** * 測試 setCache 傳入不正確的東西 * @expectedException Pix_Table_Exception */ public function testSetCacheException() { Pix_Table::setCache(123); }
public function testNullOrFalse() { Pix_Table::$_save_memory = false; $cache = new Pix_Table_TableCacheTest_Cache(); Pix_Table::setCache($cache); $table = Pix_Table::getTable('Pix_Table_TableCacheTest_User'); $table->enableTableCache(); // 什麼都沒有是 false $this->assertTrue($table->getRowFromCache(6) === false); // cacheRow null 後是 null (表示被刪除) $table->cacheRow(7, null); $this->assertTrue($table->getRowFromCache(7) === null); // cacheRow false 後是 false $table->cacheRow(8, false); $this->assertTrue($table->getRowFromCache(8) === false); }