clearInstance() public static method

public static clearInstance ( )
 public function tearDown()
 {
     $this->app['orm.em']->close();
     $this->app['orm.em'] = null;
     Application::clearInstance();
     $this->app = null;
 }
Example #2
0
 /**
  * PHPUnit_* インスタンスのプロパティを初期化する.
  *
  * このメソッドは、PHPUnit のメモリリーク解消のため、 tearDown() メソッドでコールされる.
  *
  * @link http://stackoverflow.com/questions/13537545/clear-memory-being-used-by-php
  */
 protected function cleanUpProperties()
 {
     $refl = new \ReflectionObject($this);
     foreach ($refl->getProperties() as $prop) {
         if (!$prop->isStatic() && 0 !== strpos($prop->getDeclaringClass()->getName(), 'PHPUnit_')) {
             $prop->setAccessible(true);
             $prop->setValue($this, null);
         }
     }
     \Eccube\Application::clearInstance();
 }