Ejemplo n.º 1
0
 protected function setUp()
 {
     $di = new DependencyInjection();
     $di->set('session', function () use($di) {
         return new Session();
     });
     DI::setDefault($di);
 }
Ejemplo n.º 2
0
 public function testDI()
 {
     $di = new DependencyInjection();
     $hash = spl_object_hash($di);
     DI::setDefault($di);
     $afterDI = DI::getDefault();
     $getHash = spl_object_hash($afterDI);
     $this->assertEquals($hash, $getHash);
 }