class UpdateUploaderTestBase
Same name and namespace in other branches
- 10 core/modules/update/tests/src/Functional/UpdateUploaderTestBase.php \Drupal\Tests\update\Functional\UpdateUploaderTestBase
Base test class for tests that test project upload functionality.
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\update\Functional\UpdateTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\update\Functional\UpdateUploaderTestBase implements \Drupal\Tests\update\Functional\UpdateTestBase
- class \Drupal\Tests\update\Functional\UpdateTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of UpdateUploaderTestBase
File
-
core/
modules/ update/ tests/ src/ Functional/ UpdateUploaderTestBase.php, line 10
Namespace
Drupal\Tests\update\FunctionalView source
abstract class UpdateUploaderTestBase extends UpdateTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
// Change the root path which Update Manager uses to install and update
// projects to be inside the testing site directory. See
// \Drupal\update\UpdateRootFactory::get() for equivalent changes to the
// test child site.
$request = \Drupal::request();
$update_root = $this->container
->get('update.root') . '/' . DrupalKernel::findSitePath($request);
$this->container
->get('update.root')
->set($update_root);
// Create the directories within the root path within which the Update
// Manager will install projects.
foreach (drupal_get_updaters() as $updater_info) {
$updater = $updater_info['class'];
$install_directory = $update_root . '/' . $updater::getRootDirectoryRelativePath();
if (!is_dir($install_directory)) {
mkdir($install_directory);
}
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.