public function testUpdateWithDeletion()
 {
     TestConfigCleaner::removeExtFile();
     copy(__DIR__ . '/../../data/more-extensions.php', __DIR__ . '/../../testapp/config/extensions.php');
     ExtensionFileWriter::updateConfig();
     $a = $this->checkFile();
     $this->assertEquals(4, count($a));
 }
 public function tearDown()
 {
     parent::tearDown();
     if (\Yii::$app && \Yii::$app->has('session', true)) {
         \Yii::$app->session->close();
     }
     \Yii::$app = null;
     TestConfigCleaner::cleanTestConfigs();
 }
 public function tearDown()
 {
     Yii::$app->runAction('migrate/down', [99999, 'interactive' => 0, 'migrationPath' => self::$migrationPath]);
     parent::tearDown();
     if (Yii::$app && Yii::$app->has('session', true)) {
         Yii::$app->session->close();
     }
     Yii::$app = null;
     self::writeExtFile();
     TestConfigCleaner::cleanTestConfigs();
 }
 public static function tearDownAfterClass()
 {
     TestConfigCleaner::cleanTestConfigs();
 }
 /**
  * This test runs last, because it overrides extensions.php file from installed.json
  * and we have no activated and core extensions there
  *
  * @depends testGetModule
  * @param ExtensionsManager $module
  */
 public function testGetExtensionsNoFile(ExtensionsManager $module)
 {
     TestConfigCleaner::removeExtFile();
     $a = $module->getExtensions('', true);
     $this->assertTrue(TestConfigCleaner::checkExtFile());
     $this->assertEquals(4, count($a));
 }
 public function testHandleBadQueue()
 {
     TestConfigCleaner::removeExtFile();
     $this->assertFalse(TestConfigCleaner::checkExtFile());
     Yii::setAlias('@vendor', realpath(__DIR__ . '/../../testapp/vendor'));
     $group = new DeferredGroup();
     $group->loadDefaultValues();
     $group->name = ExtensionsManager::ACTIVATE_DEFERRED_TASK;
     $group->group_notifications = 0;
     $group->save();
     $queue = new DeferredQueue([]);
     $queue->deferred_group_id = $group->id;
     $process = new Process('pwd > /dev/null');
     $process->run();
     $queue->setProcess($process);
     $queue->exit_code = 1;
     $event = new DeferredQueueCompleteEvent($queue);
     DeferredQueueCompleteHandler::handleEvent($event);
     $this->assertFalse(TestConfigCleaner::checkExtFile());
 }