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)); }
/** * 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()); }