Пример #1
0
 /**
  * Reset will clear the stored instance.
  * 
  * @dataProvider instanceNameDataProvider
  * @runInSeparateProcess
  */
 public function testResetWillClearTheStoredInstance($instanceName)
 {
     $default = new Container();
     $response = Container::getInstance($instanceName);
     $instances = \PHPUnit_Framework_Assert::readAttribute($response, 'instances');
     if (!isset($instances[$instanceName])) {
         $selectedInstance = $instances['default'];
     } else {
         $selectedInstance = $instances[$instanceName];
     }
     static::assertSame($response, $selectedInstance);
     Container::reset();
     static::assertNull(\PHPUnit_Framework_Assert::readAttribute($default, 'instances'));
 }