public function testCanNotAddWhenReadOnly() { $map = new TMap(array(), true); try { $map->add('key', 'value'); } catch (TInvalidOperationException $e) { return; } self::fail('An expected TInvalidOperationException was not raised'); }
/** * Adds an item into the map. * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. * @param mixed key * @param mixed value */ public function add($key, $value) { parent::add($this->_caseSensitive ? $key : strtolower($key), $value); }