Inheritance: extends ArrayObject
 function testUsed()
 {
     $hash = new HTMLPurifier_StringHash(array('key' => 'value', 'key2' => 'value2'));
     $this->assertIdentical($hash->getAccessed(), array());
     $t = $hash->offsetGet('key');
     $this->assertIdentical($hash->getAccessed(), array('key' => true));
     $hash->resetAccessed();
     $this->assertIdentical($hash->getAccessed(), array());
 }
Beispiel #2
0
 /**
  * Triggers errors for any unused keys passed in the hash; such keys
  * may indicate typos, missing values, etc.
  * @param HTMLPurifier_StringHash $hash Hash to check.
  */
 protected function _findUnused($hash)
 {
     $accessed = $hash->getAccessed();
     foreach ($hash as $k => $v) {
         if (!isset($accessed[$k])) {
             trigger_error("String hash key '{$k}' not used by builder", E_USER_NOTICE);
         }
     }
 }