예제 #1
0
 /**
  * Test that it registers the specified collectors
  *
  * @return void
  */
 public function test_it_registers_specified_collectors()
 {
     $this->warden->start();
     $this->warden->stop();
     $params = $this->warden->getParams();
     $this->assertNotNull($params->getValue('request_memory'));
 }
 /**
  * Call method, performs the call and sends the result to the dispatcher
  *
  * @param String $method
  * @param Array $params
  * @return Mixed
  */
 public function __call($method, array $params = array())
 {
     $before = new BeforeMethodEvent($this->alias, $method, $this->warden->getParams());
     $this->dispatch->dispatch(WardenEvents::BEFORE_METHOD, $before);
     $returnValue = call_user_func_array([$this->service, $method], $params);
     $after = new AfterMethodEvent($this->alias, $method, $returnValue, $this->warden->getParams());
     $this->dispatch->dispatch(WardenEvents::AFTER_METHOD, $after);
     return $returnValue;
 }
예제 #3
0
 /**
  * Test that the governor classes can access the param bag
  *
  * @return void
  */
 public function test_governor_using_parambag()
 {
     $warden = new Warden();
     $warden->addGovernor(new TestGovernor());
     $warden->start();
     $d = $warden->getGovernor('testGov');
     $d->getAValue();
     $params = $warden->getParams();
     $this->assertEquals(52, $params->getValue('governor_test'));
 }