Beispiel #1
0
 /**
  * Set a DI promise object on every
  * class var that ends with 'Service'
  */
 public function attachServices($obj)
 {
     $args = get_class_vars(get_class($obj));
     foreach ($args as $_k => $_v) {
         if (substr($_k, -7) == 'Service') {
             $obj->{$_k} = _makePromise($_k);
         }
     }
 }
Beispiel #2
0
 /**
  */
 public function test_create_a_promise_with_args()
 {
     _didef('dummyobj', 'tests/dummyobj.txt', 'A', 'B');
     $obj = _makePromise('dummyobj');
     $this->assertEquals('metrodi_promise', strtolower(get_class($obj)));
     $this->assertEquals('A', $obj->request);
     $this->assertEquals('B', $obj->response);
 }