Example #1
0
 public function testDestroyAllInstances()
 {
     $count = 0;
     $this->app->set('testObj', function () use(&$count) {
         $obj = new \stdClass();
         $obj->id = ++$count;
         return $obj;
     });
     $obj1 = $this->app->get('testObj');
     $this->app->destroyAllInstances();
     $obj2 = $this->app->get('testObj');
     $obj3 = $this->app->get('testObj');
     $this->assertNotEquals($obj1->id, $obj2->id);
     $this->assertEquals($obj2->id, $obj3->id);
 }