function testRender_object() { $object = new lmbObject(); $object->set('foo', 42); $this->view->set('object', $object); $this->_checkValue('{"object":{"foo":42}}'); }
function get($name, $default = LIMB_UNDEFINED) { if (!$name) { throw new lmbInvalidArgumentException('Option name not given'); } try { return parent::get($name, $default); } catch (lmbNoSuchPropertyException $e) { throw new lmbNoSuchPropertyException('Option ' . $name . ' not found', array('config' => $this->_file)); } }
/** * Plain export of object data(lazy properties not included if not loaded) * @see lmbObject::export() * @return array */ function exportRaw() { return parent::export(); }
protected function _getConfig($dsn = null, $cache_name = 'test') { $config = new lmbObject(); $config->set('cache_enabled', true); if ($dsn) { $config->set($cache_name . '_cache_dsn', $dsn); } else { $config->set($cache_name . '_cache_dsn', 'memory:'); } return $config; }
function testImplementsArrayAccessInterface() { $o = new lmbObject(); $o->set('foo', 'Bar'); $this->assertEqual($o['foo'], 'Bar'); $o['foo'] = 'Zoo'; $this->assertEqual($o->get('foo'), 'Zoo'); unset($o['foo']); $this->assertFalse($o->has('foo')); $o->set('foo', 'Bar'); $this->assertTrue(isset($o['foo'])); $this->assertFalse(isset($o['bar'])); }
/** * Gets variable from toolkit directly * @return mixed */ function getRaw($var) { return parent::_getRaw($var); }
function testObjectClone() { $value = 'bar'; $obj = new lmbObject(); $obj->set('foo', $value); $this->cache->set($id = $this->_getUniqueId('testObjectClone'), $obj); $obj->set('foo', 'new value'); $cached_obj = $this->cache->get($id); if ($this->assertIsA($cached_obj, 'lmbObject')) { $this->assertEqual($value, $cached_obj->get('foo')); } }
function __construct($message, $fields = array(), $values = array()) { parent::__construct(array('message' => $message, 'fields' => $fields, 'values' => $values)); }
protected function _getFilled($name) { $value = parent::_getRaw($name); return $this->_fillTemplate($value); }
function testGetClass() { $wrapped = new lmbObject(); $proxy = new ProxyTestingStub($wrapped); $this->assertEqual($proxy->getClass(), $wrapped->getClass()); }