Loading core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * * @group update */ class FileTransferAuthorizeFormTest extends UpdateTestBase { class FileTransferAuthorizeFormTest extends UpdateUploaderTestBase { /** * Modules to enable. Loading core/modules/update/tests/src/Functional/UpdateTestBase.php +0 −23 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ namespace Drupal\Tests\update\Functional; use Drupal\Core\DrupalKernel; use Drupal\Core\Url; use Drupal\Tests\BrowserTestBase; Loading Loading @@ -54,28 +53,6 @@ abstract class UpdateTestBase extends BrowserTestBase { */ protected $updateProject; 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); } } } /** * Refreshes the update status based on the desired available update scenario. * Loading core/modules/update/tests/src/Functional/UpdateUploadTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ * * @group update */ class UpdateUploadTest extends UpdateTestBase { class UpdateUploadTest extends UpdateUploaderTestBase { use TestFileCreationTrait { getTestFiles as drupalGetTestFiles; Loading core/modules/update/tests/src/Functional/UpdateUploaderTestBase.php 0 → 100644 +37 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\update\Functional; use Drupal\Core\DrupalKernel; /** * Base test class for tests that test project upload functionality. */ 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); } } } } Loading
core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * * @group update */ class FileTransferAuthorizeFormTest extends UpdateTestBase { class FileTransferAuthorizeFormTest extends UpdateUploaderTestBase { /** * Modules to enable. Loading
core/modules/update/tests/src/Functional/UpdateTestBase.php +0 −23 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ namespace Drupal\Tests\update\Functional; use Drupal\Core\DrupalKernel; use Drupal\Core\Url; use Drupal\Tests\BrowserTestBase; Loading Loading @@ -54,28 +53,6 @@ abstract class UpdateTestBase extends BrowserTestBase { */ protected $updateProject; 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); } } } /** * Refreshes the update status based on the desired available update scenario. * Loading
core/modules/update/tests/src/Functional/UpdateUploadTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ * * @group update */ class UpdateUploadTest extends UpdateTestBase { class UpdateUploadTest extends UpdateUploaderTestBase { use TestFileCreationTrait { getTestFiles as drupalGetTestFiles; Loading
core/modules/update/tests/src/Functional/UpdateUploaderTestBase.php 0 → 100644 +37 −0 Original line number Diff line number Diff line <?php namespace Drupal\Tests\update\Functional; use Drupal\Core\DrupalKernel; /** * Base test class for tests that test project upload functionality. */ 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); } } } }