function testError() { $plug = PMVC\plug($this->_plug); \PMVC\plug('debug', ['output' => $plug]); ob_start(); \PMVC\d('aaa'); $output = ob_get_contents(); ob_end_clean(); $this->assertContains('string(3) "aaa"', $output); }
/** * @expectedException UnderflowException */ function testDebugForwardNotExists() { $c = \PMVC\plug('controller'); $mapping = $c->getMapping(); $b = new \PMVC\MappingBuilder(); $key = \PMVC\ACTION_FORWARDS; $b[$key]['debug'] = null; $mapping->addByKey($key, $b); $debugStore = \PMVC\plug($this->_plug); \PMVC\d('fake'); $debugStore->onFinish(); }
public function init() { if (empty($this['ssdb'])) { $get = \PMVC\plug('get'); $host = $get->get('SSDB_HOST'); if (empty($host)) { return; } try { $ssdb = new \SimpleSSDB($host, $get->get('SSDB_PORT')); $this['ssdb'] = $ssdb; $this->setDefaultAlias($this['ssdb']); $this->setConnected(true); } catch (Exception $e) { \PMVC\log($e->getMessage()); \PMVC\d($e->getMessage()); } } }