/** * @covers Microsite\App::demand * @covers Microsite\App::__call */ public function testDemand() { $this->app->demand('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('pass'); // Since this object is on demand, the second creation call should create a new object, // and the value should be different $this->assertEquals('pass', $b->param); }