Example #1
0
 public function onMapRequest()
 {
     $accept = \PMVC\plug('getenv')->get('HTTP_ACCEPT');
     if ('application/json' === $accept) {
         \PMVC\plug('controller')[_VIEW_ENGINE] = 'json';
         \PMVC\unplug('view_config_helper');
     }
 }
Example #2
0
 function testIsset()
 {
     \PMVC\unplug('curl');
     $curl = \PMVC\plug('curl', [_CLASS => __NAMESPACE__ . '\\fakeCurl']);
     $curl['r'] = ['code' => 200];
     $algo = \PMVC\plug($this->_plug);
     $db = $algo->getDb('parking');
     $this->assertTrue(isset($db['fake']));
     $curl['r'] = ['code' => 404];
     $this->assertFalse(isset($db['fake']));
 }
Example #3
0
 function teardown()
 {
     \PMVC\unplug($this->_plug);
 }
Example #4
0
 function setup()
 {
     PMVC\unplug($this->_plug);
 }
Example #5
0
 function testIsDevForUnPlug()
 {
     \PMVC\unplug($this->_plug);
     $this->assertFalse(\PMVC\isDev('trace'));
 }
Example #6
0
 function teardown()
 {
     \PMVC\unplug($this->_plug);
     \PMVC\unplug('view');
     \PMVC\unplug('controller');
 }
 public function setup()
 {
     \PMVC\unplug('controller');
 }
Example #8
0
 function tearDown()
 {
     if (\PMVC\exists($this->_plug, 'plugin')) {
         \PMVC\unplug($this->_plug);
     }
 }