Skip to content

Commit

Permalink
fix(deps): use site-default for testing instead of site-blank
Browse files Browse the repository at this point in the history
  • Loading branch information
dadish committed Jul 2, 2022
1 parent caf27b3 commit a00703e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"require-dev": {
"processwire/processwire": "dev-dev",
"processwire/site-default": "1.0.0",
"ryancramerdesign/fieldtypemapmarker": "1.0.0",
"dadish/graphqlfieldtypemapmarker": "2.0.0",
"phpunit/phpunit": "9.5.10"
Expand All @@ -24,6 +25,17 @@
"type": "vcs",
"url": "https://github.com/processwire/processwire"
},
{
"type": "package",
"package": {
"name": "processwire/site-default",
"version": "1.0.0",
"dist": {
"type": "zip",
"url": "https://github.com/processwire/site-default/archive/master.zip"
}
}
},
{
"type": "package",
"package": {
Expand Down
11 changes: 10 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// paths
$baseDir = realpath(__DIR__ . "/../");
$pwDir = realpath($baseDir . "/vendor/processwire/processwire/");
$siteDir = realpath($pwDir . "/site-blank/");
$siteDir = realpath($baseDir . "/vendor/processwire/site-default/");
$moduleDir = $siteDir . "/modules/ProcessGraphQL";
$testFilesDir = realpath($baseDir . "/test/files");
$siteFilesDir = $siteDir . "/assets/files";
Expand All @@ -23,7 +23,7 @@
unlink($installFile);
}

// overwrite site-blank's config.php with our own custom one
// overwrite site-defaults's config.php with our own custom one
copy(__DIR__ . "/site/config.php", $siteDir . "/config.php");

// symlink site/classes directory
Expand Down Expand Up @@ -62,16 +62,21 @@
\symlink($mapMarkerGraphQLDir, $mapMarkerGraphQLDestDir);
}

// symlink the site-default to vendor/processwire/processwire/site
// so it is next to wire directory.
$siteDirDest = $pwDir . "/site";
if (!file_exists($siteDirDest)) {
\symlink($siteDir, $siteDirDest);
}

// symlink skyscrapers pages files to site's asset files
if (!file_exists($siteFilesDir)) {
\symlink($testFilesDir, $siteFilesDir);
}

use ProcessWire\ProcessWire;

$config = ProcessWire::buildConfig($pwDir, null, [
"siteDir" => "site-blank"
]);
$config = ProcessWire::buildConfig($pwDir);

require_once realpath(__DIR__ . "/databaseReset.php");

Expand Down
4 changes: 1 addition & 3 deletions test/cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

use ProcessWire\ProcessWire;

$config = ProcessWire::buildConfig($pwDir, null, [
"siteDir" => "site-default"
]);
$config = ProcessWire::buildConfig($pwDir);

require_once realpath(__DIR__ . "/databaseReset.php");

Expand Down

0 comments on commit a00703e

Please sign in to comment.