Skip to content
Snippets Groups Projects

Add a core-convert job

Merged Adam G-H requested to merge issue/automatic_updates-3414168:3414168-add-a-new into 3.0.x
Compare and Show latest version
1 file
+ 7
7
Compare changes
  • Side-by-side
  • Inline
@@ -8,7 +8,6 @@ use Composer\Autoload\ClassLoader;
use Composer\InstalledVersions;
use Drupal\BuildTests\QuickStart\QuickStartTestBase;
use Drupal\Component\Serialization\Yaml;
use Drupal\Composer\Composer;
use Drupal\package_manager\Event\CollectPathsToExcludeEvent;
use Drupal\package_manager_test_event_logger\EventSubscriber\EventLogSubscriber;
use Drupal\Tests\package_manager\Traits\AssertPreconditionsTrait;
@@ -94,14 +93,15 @@ abstract class TemplateProjectTestBase extends QuickStartTestBase {
// these are updated as well, despite `sites/default` being write-protected.
// @see ::assertUpdateSuccessful()
// @see ::createTestProject()
$workspace_dir = $this->getWorkspaceDirectory();
require_once "$workspace_dir/composer/Composer.php";
Composer::setDrupalVersion($workspace_dir, $version);
file_put_contents("$workspace_dir/core/README.txt", "Placeholder for Drupal core $version.");
// @see \Drupal\Composer\Composer::setDrupalVersion()
$core_dir = $this->getWorkspaceDrupalRoot() . '/core';
$drupal_static_path = "$core_dir/lib/Drupal.php";
$drupal_static_source = preg_replace('#const VERSION = [^;]*#', "const VERSION = '$version'", file_get_contents($drupal_static_path));
file_put_contents($drupal_static_path, $drupal_static_source);
file_put_contents("$core_dir/README.txt", "Placeholder for Drupal core $version.");
foreach (['default.settings.php', 'default.services.yml'] as $file) {
$bytes_written = file_put_contents("$workspace_dir/core/assets/scaffold/files/$file", "# This is part of Drupal $version.\n", FILE_APPEND);
$this->assertIsInt($bytes_written);
file_put_contents("$core_dir/assets/scaffold/files/$file", "# This is part of Drupal $version.\n", FILE_APPEND);
}
}
Loading