Exemple #1
0
 /**
  * @covers Microsite\App::share
  * @covers Microsite\App::__call
  */
 public function testShare()
 {
     $this->app->share('obj', function ($param) {
         $obj = new \stdClass();
         $obj->param = $param;
         return $obj;
     });
     $a = $this->app->obj('test');
     $this->assertEquals('test', $a->param);
     $b = $this->app->obj('fail');
     // Since this object is shared, the second creation call should do nothing,
     // and the value should be the same
     $this->assertEquals('test', $b->param);
 }