From f21b240d7366402733a68b58a4864e23b798f701 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 12 Apr 2024 12:04:33 +0200 Subject: [PATCH 1/2] fix(setup) handle custom installations better, hello Bedrock --- includes/cli-server/router.php | 65 ++-- includes/sqlite-database-integration/load.php | 4 +- src/Project/SiteProject.php | 33 +- src/Project/TestEnvironment.php | 4 + src/Template/Wpbrowser.php | 20 +- src/WordPress/CodeExecution/InstallAction.php | 21 +- src/WordPress/FileRequests/FileRequest.php | 6 +- src/WordPress/Installation.php | 13 +- src/WordPress/Traits/WordPressChecks.php | 1 - .../Codeception/Template/WpbrowserTest.php | 51 +++ ...ite_with_non_default_structure__0.snapshot | 7 +- ...re_using_default_configuration__0.snapshot | 294 ++++++++++++++++++ ...fold_for_child_theme_correctly__0.snapshot | 15 +- ...d_for_multi_site_correctly__0.snapshot.txt | 2 + ...ffold_for_multi_site_correctly__1.snapshot | 15 +- ...lugin_with_non_plugin_php_file__0.snapshot | 15 +- ...ith_non_plugin_php_file_custom__0.snapshot | 7 +- ...or_plugin_with_plugin_php_file__0.snapshot | 15 +- ...in_with_plugin_php_file_custom__0.snapshot | 7 +- ..._for_single_site_correctly__0.snapshot.txt | 2 + ...fold_for_single_site_correctly__1.snapshot | 15 +- ...d_scaffold_for_theme_correctly__0.snapshot | 15 +- ...old_for_theme_custom_correctly__0.snapshot | 7 +- 23 files changed, 533 insertions(+), 101 deletions(-) create mode 100644 tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure_using_default_configuration__0.snapshot diff --git a/includes/cli-server/router.php b/includes/cli-server/router.php index 422496628..cd0528460 100644 --- a/includes/cli-server/router.php +++ b/includes/cli-server/router.php @@ -5,40 +5,57 @@ */ $root = $_SERVER['DOCUMENT_ROOT']; -$path = '/'. ltrim( parse_url( urldecode( $_SERVER['REQUEST_URI'] ),PHP_URL_PATH ), '/' ); +$path = '/' . ltrim(parse_url(urldecode($_SERVER['REQUEST_URI']), PHP_URL_PATH), '/'); define('DB_ENGINE', getenv('DB_ENGINE') ?: 'mysql'); // Add a unique request ID to the headers. -$requestId = md5( microtime() ); +$requestId = md5(microtime()); $_SERVER['REQUEST_ID'] = $requestId; -header( 'X-Request-ID: ' . $requestId ); +header('X-Request-ID: ' . $requestId); // Disable the MU upgrade routine. global $wp_filter; $wp_filter['do_mu_upgrade'][10][] = [ 'accepted_args' => 0, - 'function' => '__return_false' + 'function' => '__return_false' ]; - -if ( file_exists( $root.$path ) ) { - - // Enforces trailing slash, keeping links tidy in the admin - if ( is_dir( $root.$path ) && substr_compare($path, '/', -strlen('/')) !== 0 ) { - header( "Location: $path/" ); - exit; - } - - // Runs PHP file if it exists - if ( strpos($path, '.php') !== false ) { - chdir( dirname( $root.$path ) ); - require_once $root.$path; - } else { - return false; - } +$wpbrowserSiteurl = getenv('WPBROWSER_SITEURL'); +$wpbrowserHomeUrl = getenv('WPBROWSER_HOMEURL'); +if ($wpbrowserSiteurl) { + $wp_filter['option_siteurl'][1000][] = [ + 'accepted_args' => 0, + 'function' => function () use ($wpbrowserSiteurl) { + return $wpbrowserSiteurl; + } + ]; +} +if (getenv('WPBROWSER_HOMEURL')) { + $wp_filter['option_home'][1000][] = [ + 'accepted_args' => 0, + 'function' => function () use ($wpbrowserHomeUrl) { + return $wpbrowserHomeUrl; + } + ]; +} +unset($wpbrowserSiteurl, $wpbrowserHomeUrl); + +if (file_exists($root . $path)) { + // Enforces trailing slash, keeping links tidy in the admin + if (is_dir($root . $path) && substr_compare($path, '/', -strlen('/')) !== 0) { + header("Location: $path/"); + exit; + } + + // Runs PHP file if it exists + if (strpos($path, '.php') !== false) { + chdir(dirname($root . $path)); + require_once $root . $path; + } else { + return false; + } } else { - - // Otherwise, run `index.php` - chdir( $root ); - require_once 'index.php'; + // Otherwise, run `index.php` + chdir($root); + require_once 'index.php'; } diff --git a/includes/sqlite-database-integration/load.php b/includes/sqlite-database-integration/load.php index 3af809035..ddc5a9b6c 100644 --- a/includes/sqlite-database-integration/load.php +++ b/includes/sqlite-database-integration/load.php @@ -12,7 +12,9 @@ * @package wp-sqlite-integration */ -define( 'SQLITE_MAIN_FILE', __FILE__ ); +if (!defined('SQLITE_MAIN_FILE')) { + define('SQLITE_MAIN_FILE', __FILE__); +} require_once __DIR__ . '/admin-page.php'; require_once __DIR__ . '/activate.php'; diff --git a/src/Project/SiteProject.php b/src/Project/SiteProject.php index a1ff34bbb..d6118001e 100644 --- a/src/Project/SiteProject.php +++ b/src/Project/SiteProject.php @@ -12,6 +12,7 @@ use lucatume\WPBrowser\Exceptions\RuntimeException; use lucatume\WPBrowser\Extension\BuiltInServerController; use lucatume\WPBrowser\Extension\ChromeDriverController; +use lucatume\WPBrowser\Template\Wpbrowser; use lucatume\WPBrowser\Utils\ChromedriverInstaller; use lucatume\WPBrowser\Utils\Codeception; use lucatume\WPBrowser\Utils\Filesystem as FS; @@ -58,7 +59,7 @@ public function __construct(InputInterface $input, OutputInterface $output, stri ); } - $suggest = "Make sure you're initializing wp-browser at the root of your site project,". + $suggest = "Make sure you're initializing wp-browser at the root of your site project," . " and that the directory contains the WordPress files and a wp-config.php file."; if ($installationState instanceof EmptyDir) { @@ -106,7 +107,8 @@ public function setup(): void } $contentDir = $this->installation->getContentDir(); - Installation::placeSqliteMuPlugin($this->installation->getMuPluginsDir(), $contentDir); + $dropInPath = Installation::placeSqliteMuPlugin($this->installation->getMuPluginsDir(), $contentDir); + Wpbrowser::setDropInPath($dropInPath); $this->sayInfo('SQLite drop-in placed, installing WordPress ...'); $serverLocalhostPort = Random::openLocalhostPort(); @@ -152,6 +154,22 @@ public function setup(): void EOT; + $docRootEnvVar = "%WORDPRESS_ROOT_DIR%"; + $docRoot = dirname($this->installation->getWpConfigFilePath()); + $siteUrlRelativePath = ''; + $wpRootDir = $this->installation->getWpRootDir(); + if ($docRoot !== rtrim($wpRootDir, '/')) { + $docRootRelativePath = FS::relativePath($this->workDir, $docRoot); + $docRootEnvVar = '%WORDPRESS_DOCROOT%'; + $siteUrlRelativePath = rtrim('/' . ltrim(FS::relativePath($docRoot, $wpRootDir), '/'), '/'); + $this->testEnvironment->extraEnvFileContents .= <<testEnvironment->extensionsEnabled = [ ChromeDriverController::class => [ 'port' => "%CHROMEDRIVER_PORT%", @@ -159,12 +177,14 @@ public function setup(): void BuiltInServerController::class => [ 'workers' => 5, 'port' => "%BUILTIN_SERVER_PORT%", - 'docroot' => "%WORDPRESS_ROOT_DIR%", + 'docroot' => $docRootEnvVar, 'env' => [ 'DATABASE_TYPE' => 'sqlite', 'DB_ENGINE' => 'sqlite', 'DB_DIR' => '%codecept_root_dir%' . DIRECTORY_SEPARATOR . $dataDirRelativePath, - 'DB_FILE' => 'db.sqlite' + 'DB_FILE' => 'db.sqlite', + 'WPBROWSER_SITEURL' => '%WORDPRESS_URL%' . $siteUrlRelativePath, + 'WPBROWSER_HOMEURL' => '%WORDPRESS_URL%' ] ] @@ -174,7 +194,8 @@ public function setup(): void $this->testEnvironment->customCommands[] = DevInfo::class; $this->testEnvironment->customCommands[] = DevRestart::class; $this->testEnvironment->customCommands[] = ChromedriverUpdate::class; - $this->testEnvironment->wpRootDir = '.'; + $this->testEnvironment->wpRootDir = FS::relativePath($this->workDir, $wpRootDir) ?: '.'; + $this->testEnvironment->wpAdminPath = '/' . ltrim(FS::relativePath($docRoot, $wpRootDir . '/wp-admin'), '/'); $this->testEnvironment->dbUrl = 'sqlite://' . implode( DIRECTORY_SEPARATOR, ['%codecept_root_dir%', $dataDirRelativePath, 'db.sqlite'] @@ -193,7 +214,7 @@ public function getTestEnv(): ?TestEnvironment private function getName(): string { - return basename(dirname($this->workDir)); + return basename($this->workDir); } private function scaffoldEndToEndActivationCest(): void diff --git a/src/Project/TestEnvironment.php b/src/Project/TestEnvironment.php index 5f338eb32..6938a0aec 100644 --- a/src/Project/TestEnvironment.php +++ b/src/Project/TestEnvironment.php @@ -30,6 +30,10 @@ class TestEnvironment * @var string */ public $wpDomain = 'wordpress.test'; + /** + * @var string + */ + public $wpAdminPath = '/wp-admin'; /** * @var string */ diff --git a/src/Template/Wpbrowser.php b/src/Template/Wpbrowser.php index 4c55cb022..8cbfb4bca 100644 --- a/src/Template/Wpbrowser.php +++ b/src/Template/Wpbrowser.php @@ -28,6 +28,10 @@ class Wpbrowser extends Bootstrap * @var \lucatume\WPBrowser\Project\TestEnvironment|null */ private $testEnvironment; + /** + * @var string + */ + private static $dropInPath = ''; /** * @throws RuntimeException @@ -199,6 +203,7 @@ private function createEnvFile(): void # The URL and domain of the WordPress site used in end-to-end tests. WORDPRESS_URL={$testEnv->wpUrl} WORDPRESS_DOMAIN={$testEnv->wpDomain} +WORDPRESS_ADMIN_PATH={$testEnv->wpAdminPath} # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER={$testEnv->wpAdminUser} @@ -241,7 +246,7 @@ private function createEndToEndSuite(ProjectInterface $project): void url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -269,10 +274,10 @@ private function createEndToEndSuite(ProjectInterface $project): void wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + EOF; $this->createSuite('EndToEnd', 'EndToEnd', $suiteConfig); $bootstrapContents = <<input, $this->output, $workDir); } + public static function setDropInPath(string $path): void + { + self::$dropInPath = $path; + } + protected function cleanUpOnFail(): void { FS::rrmdir($this->workDir . '/tests'); if (is_file($this->workDir . '/codeception.yml')) { @unlink($this->workDir . '/codeception.yml'); } + + if (self::$dropInPath && file_exists(self::$dropInPath)) { + @unlink(self::$dropInPath); + } } } diff --git a/src/WordPress/CodeExecution/InstallAction.php b/src/WordPress/CodeExecution/InstallAction.php index 0acca080a..0274b7287 100644 --- a/src/WordPress/CodeExecution/InstallAction.php +++ b/src/WordPress/CodeExecution/InstallAction.php @@ -4,10 +4,15 @@ use Closure; use lucatume\WPBrowser\WordPress\FileRequests\FileRequest; +use lucatume\WPBrowser\WordPress\Traits\WordPressChecks; +use lucatume\WPBrowser\WordPress\WPConfigFile; + use function wp_slash; class InstallAction implements CodeExecutionActionInterface { + use WordPressChecks; + /** * @var \lucatume\WPBrowser\WordPress\FileRequests\FileRequest */ @@ -27,7 +32,7 @@ public function __construct( ->setTargetFile($wpRootDir . '/wp-load.php') ->defineConstant('WP_INSTALLING', true) ->defineConstant('MULTISITE', false) - ->addPreloadClosure(function () use ($url): void { + ->addPreloadClosure(function (): void { // The `MULTISITE` const might be already defined in the `wp-config.php` file. // If that is the case, silence the error. set_error_handler(static function ($errno, $errstr): bool { @@ -42,14 +47,20 @@ public function __construct( // Plug the `wp_mail` function to avoid the sending of emails. require_once dirname(__DIR__, 3) . '/includes/pluggables/function-wp-mail.php'; - - if (!defined('WP_SITEURL')) { - define('WP_SITEURL', $url); - } }) ->addAfterLoadClosure(function () use ($title, $adminUser, $adminPassword, $adminEmail) { return $this->installWordPress($title, $adminUser, $adminPassword, $adminEmail); }); + + // Define the `WP_SITEURL` constant if not already defined in the wp-config.php file. + $wpConfigFilePath = $this->findWpConfigFilePath($wpRootDir); + if ($wpConfigFilePath) { + $wpConfigFile = new WPConfigFile($wpRootDir, $wpConfigFilePath); + if (!$wpConfigFile->getConstant('WP_SITEURL')) { + $request->defineConstant('WP_SITEURL', $url); + } + } + $this->request = $request; } diff --git a/src/WordPress/FileRequests/FileRequest.php b/src/WordPress/FileRequests/FileRequest.php index 549cc6298..76931e386 100644 --- a/src/WordPress/FileRequests/FileRequest.php +++ b/src/WordPress/FileRequests/FileRequest.php @@ -165,8 +165,10 @@ public function execute(): array PreloadFilters::addFilter($hookName, $callback, $priority, $acceptedArgs); } - // Reveal the errors. - define('WP_DISABLE_FATAL_ERROR_HANDLER', true); + // Reveal the errors: disable the fatal error handler. + PreloadFilters::addFilter('wp_fatal_error_handler_enabled', function () { + return false; + }, 1000); // Set up the cookie jar. foreach ($this->cookieJar as $key => $value) { diff --git a/src/WordPress/Installation.php b/src/WordPress/Installation.php index a603f2701..5c04a5aaf 100644 --- a/src/WordPress/Installation.php +++ b/src/WordPress/Installation.php @@ -89,13 +89,14 @@ public static function getCleanScaffoldedInstallations(): array /** * @throws InstallationException */ - public static function placeSqliteMuPlugin(string $muPluginsDir, string $contentDir): void + public static function placeSqliteMuPlugin(string $muPluginsDir, string $contentDir): string { - if (self::hasSqliteDropin($contentDir . '/db.php')) { - return; + $dropinPathname = $contentDir . '/db.php'; + if (self::hasSqliteDropin($dropinPathname)) { + return $dropinPathname; } - if (is_file($contentDir . '/db.php')) { + if (is_file($dropinPathname)) { throw new InstallationException( "The db.php file already exists in the $contentDir directory and it's not a SQLite drop-in.", InstallationException::DB_DROPIN_ALREADY_EXISTS @@ -137,7 +138,7 @@ public static function placeSqliteMuPlugin(string $muPluginsDir, string $content $dbCopyContents ); - if (!file_put_contents($contentDir . '/db.php', $updatedContents, LOCK_EX)) { + if (!file_put_contents($dropinPathname, $updatedContents, LOCK_EX)) { throw new InstallationException( "Could not write the SQLite db.php file at $contentDir.", InstallationException::SQLITE_DROPIN_COPY_FAILED @@ -153,6 +154,8 @@ public static function placeSqliteMuPlugin(string $muPluginsDir, string $content InstallationException::SQLITE_DROPIN_COPY_FAILED ); } + + return $dropinPathname; } /** diff --git a/src/WordPress/Traits/WordPressChecks.php b/src/WordPress/Traits/WordPressChecks.php index 218fca137..9f355fbe7 100644 --- a/src/WordPress/Traits/WordPressChecks.php +++ b/src/WordPress/Traits/WordPressChecks.php @@ -33,7 +33,6 @@ private function checkWPRootDir(string $wpRootDir): string return $wpRootDir; } - /** * @return string|false */ diff --git a/tests/unit/Codeception/Template/WpbrowserTest.php b/tests/unit/Codeception/Template/WpbrowserTest.php index 97ea97389..cf1ac2709 100644 --- a/tests/unit/Codeception/Template/WpbrowserTest.php +++ b/tests/unit/Codeception/Template/WpbrowserTest.php @@ -715,4 +715,55 @@ function () { } ); } + + /** + * It should scaffold correctly on site with non default structure using default configuration + * + * @test + */ + public function should_scaffold_correctly_on_site_with_non_default_structure_using_default_configuration(): void + { + if (PHP_VERSION < 8.0) { + $this->markTestSkipped('This test requires PHP 8.0 or higher.'); + } + + $projectDir = FS::tmpDir('setup_'); + $dbName = Random::dbName(); + $dbHost = Env::get('WORDPRESS_DB_HOST'); + $dbUser = Env::get('WORDPRESS_DB_USER'); + $dbPassword = Env::get('WORDPRESS_DB_PASSWORD'); + $db = new MysqlDatabase($dbName, $dbUser, $dbPassword, $dbHost, 'test_'); + (new BedrockProject($db, 'https://the-project.local'))->scaffold($projectDir); + + $this->mockComposerBin($projectDir); + + $command = [ + PHP_BINARY, + codecept_root_dir("vendor/bin/codecept"), + 'init', + 'wpbrowser', + '--path=' . $projectDir + ]; + $process = new Process($command); + + + $process->setInput( + "yes\n" // Yes, use recommended setup. + ); + + $process->mustRun(); + + // Remove some hashed files. + FS::rrmdir($projectDir . '/' . Codeception::supportDir() . '/_generated'); + FS::rrmdir($projectDir . '/' . Codeception::dataDir() . '/db.sqlite'); + FS::rrmdir($projectDir . '/' . Codeception::dataDir() . '/dump.sql'); + + // Random ports will change: visit the data to replace the random ports with a placeholder. + $this->assertMatchesDirectorySnapshot( + $projectDir . '/tests', + function () { + return $this->replaceRandomPorts(...func_get_args()); + } + ); + } } diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure__0.snapshot index c3678a437..680e49321 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /EndToEnd.suite.yml <<< >>> /Integration/_bootstrap.php >>> @@ -199,6 +199,7 @@ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. WORDPRESS_URL=http://wordpress.test WORDPRESS_DOMAIN=wordpress.test +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure_using_default_configuration__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure_using_default_configuration__0.snapshot new file mode 100644 index 000000000..62ce0a039 --- /dev/null +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_correctly_on_site_with_non_default_structure_using_default_configuration__0.snapshot @@ -0,0 +1,294 @@ +>>> /EndToEnd.suite.yml >>> +# Integration suite configuration +# +# Run integration and "WordPress unit" tests. + +actor: EndToEndTester +bootstrap: _bootstrap.php +modules: + enabled: + - lucatume\WPBrowser\Module\WPWebDriver + - lucatume\WPBrowser\Module\WPDb + - lucatume\WPBrowser\Module\WPFilesystem + - lucatume\WPBrowser\Module\WPLoader + config: + lucatume\WPBrowser\Module\WPWebDriver: + url: '%WORDPRESS_URL%' + adminUsername: '%WORDPRESS_ADMIN_USER%' + adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' + adminPath: '%WORDPRESS_ADMIN_PATH%' + browser: chrome + host: '%CHROMEDRIVER_HOST%' + port: '%CHROMEDRIVER_PORT%' + path: '/' + window_size: 1200x1000 + capabilities: + "goog:chromeOptions": + args: + - "--headless" + - "--disable-gpu" + - "--disable-dev-shm-usage" + - "--proxy-server='direct://'" + - "--proxy-bypass-list=*" + - "--no-sandbox" + lucatume\WPBrowser\Module\WPDb: + dbUrl: '%WORDPRESS_DB_URL%' + dump: 'tests/Support/Data/dump.sql' + populate: true + cleanup: true + reconnect: false + url: '%WORDPRESS_URL%' + urlReplacement: false + tablePrefix: '%WORDPRESS_TABLE_PREFIX%' + lucatume\WPBrowser\Module\WPFilesystem: + wpRootFolder: '%WORDPRESS_ROOT_DIR%' + lucatume\WPBrowser\Module\WPLoader: + loadOnly: true + wpRootFolder: '%WORDPRESS_ROOT_DIR%' + dbUrl: '%WORDPRESS_DB_URL%' + domain: '%WORDPRESS_DOMAIN%' + +<<< /EndToEnd.suite.yml <<< + +>>> /Integration/SampleTest.php >>> +post->create_and_get(); + + $this->assertInstanceOf(\WP_Post::class, $post); + } + + public function test_default_users(): void + { + $this->assertEquals(0, wp_get_current_user()->ID); + + wp_set_current_user(1); + + $this->assertEquals(1, wp_get_current_user()->ID); + $this->assertEquals('admin', wp_get_current_user()->user_login); + } +} +<<< /Integration/SampleTest.php <<< + +>>> /Integration/_bootstrap.php >>> +>> /Integration.suite.yml >>> +# Integration suite configuration +# +# Run integration and "WordPress unit" tests. + +actor: IntegrationTester +bootstrap: _bootstrap.php +modules: + enabled: + - lucatume\WPBrowser\Module\WPLoader + config: + lucatume\WPBrowser\Module\WPLoader: + wpRootFolder: "%WORDPRESS_ROOT_DIR%" + dbUrl: '%WORDPRESS_DB_URL%' + wpDebug: true + tablePrefix: '%TEST_TABLE_PREFIX%' + domain: '%WORDPRESS_DOMAIN%' + adminEmail: 'admin@%WORDPRESS_DOMAIN%' + title: 'Integration Tests' + plugins: [] + theme: '' +<<< /Integration.suite.yml <<< + +>>> /Support/IntegrationTester.php >>> +>> /Support/EndToEndTester.php >>> +>> /Support/Data/.gitkeep >>> + +<<< /Support/Data/.gitkeep <<< + +>>> /EndToEnd/_bootstrap.php >>> +` command + * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * E.g.: + * `vendor/bin/codecept wp:cli EndToEnd db import tests/Support/Data/dump.sql` to load dump file. + * `vendor/bin/codecept wp:cli EndToEnd plugin activate woocommerce` to activate the WooCommerce plugin. + * `vendor/bin/codecept wp:cli EndToEnd user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:cli EndToEnd db export tests/Support/Data/dump.sql` to update the dump file. + */ +<<< /EndToEnd/_bootstrap.php <<< + +>>> /EndToEnd/ActivationCest.php >>> +amOnPage('/'); + $I->seeElement('body'); + } + + public function test_can_login_as_admin(EndToEndTester $I): void + { + $I->loginAsAdmin(); + $I->amOnAdminPage('/'); + $I->seeElement('body.wp-admin'); + } +} + +<<< /EndToEnd/ActivationCest.php <<< + +>>> /.env >>> +# The path to the WordPress root directory, the one containing the wp-load.php file. +# This can be a relative path from the directory that contains the codeception.yml file, +# or an absolute path. +WORDPRESS_ROOT_DIR=web/wp + +# Tests will require a MySQL database to run. +# The database will be created if it does not exist. +# Do not use a database that contains important data! +WORDPRESS_DB_URL=sqlite://%codecept_root_dir%/tests/Support/Data/db.sqlite + +# The Integration suite will use this table prefix for the WordPress tables. +TEST_TABLE_PREFIX=test_ + +# This table prefix used by the WordPress site in end-to-end tests. +WORDPRESS_TABLE_PREFIX=wp_ + +# The URL and domain of the WordPress site used in end-to-end tests. +WORDPRESS_URL=http://localhost:24423 +WORDPRESS_DOMAIN=localhost:24423 +WORDPRESS_ADMIN_PATH=/wp/wp-admin + +# The username and password of the administrator user of the WordPress site used in end-to-end tests. +WORDPRESS_ADMIN_USER=admin +WORDPRESS_ADMIN_PASSWORD=password + +# The host and port of the ChromeDriver server that will be used in end-to-end tests. +CHROMEDRIVER_HOST=localhost +CHROMEDRIVER_PORT=17558 + +# The port on which the PHP built-in server will serve the WordPress installation. +BUILTIN_SERVER_PORT=24423 + +# The path to the directory that should be served on localhost, the one containing the wp-config.php file. +WORDPRESS_DOCROOT=web + +<<< /.env <<< + +>>> /_output/.gitignore >>> +* +!.gitignore + +<<< /_output/.gitignore <<< \ No newline at end of file diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_child_theme_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_child_theme_correctly__0.snapshot index 609f26756..2a777b596 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_child_theme_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_child_theme_correctly__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -257,8 +257,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:49167 -WORDPRESS_DOMAIN=localhost:49167 +WORDPRESS_URL=http://localhost:39249 +WORDPRESS_DOMAIN=localhost:39249 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -266,10 +267,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=29046 +CHROMEDRIVER_PORT=43995 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=49167 +BUILTIN_SERVER_PORT=39249 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__0.snapshot.txt b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__0.snapshot.txt index 39a0c43b7..e12a62dea 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__0.snapshot.txt +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__0.snapshot.txt @@ -26,6 +26,8 @@ extensions: DB_ENGINE: sqlite DB_DIR: '%codecept_root_dir%/tests/Support/Data' DB_FILE: db.sqlite + WPBROWSER_SITEURL: '%WORDPRESS_URL%' + WPBROWSER_HOMEURL: '%WORDPRESS_URL%' commands: - lucatume\WPBrowser\Command\RunOriginal - lucatume\WPBrowser\Command\RunAll diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__1.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__1.snapshot index 0c9d7739c..39177ae30 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__1.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_multi_site_correctly__1.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /EndToEnd.suite.yml <<< >>> /Integration/SampleTest.php >>> @@ -267,8 +267,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:52214 -WORDPRESS_DOMAIN=localhost:52214 +WORDPRESS_URL=http://localhost:9035 +WORDPRESS_DOMAIN=localhost:9035 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -276,10 +277,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=52233 +CHROMEDRIVER_PORT=21043 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=52214 +BUILTIN_SERVER_PORT=9035 <<< /.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot index 9a6067d55..94aa0c6c0 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -265,8 +265,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:52011 -WORDPRESS_DOMAIN=localhost:52011 +WORDPRESS_URL=http://localhost:53890 +WORDPRESS_DOMAIN=localhost:53890 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -274,10 +275,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=52030 +CHROMEDRIVER_PORT=27014 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=52011 +BUILTIN_SERVER_PORT=53890 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot index 67cbbad11..8f0699f8f 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot @@ -21,7 +21,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -49,10 +49,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/_bootstrap.php >>> @@ -204,6 +204,7 @@ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. WORDPRESS_URL=http://wordpress.test WORDPRESS_DOMAIN=wordpress.test +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot index 7aa3fe7ba..56be82bd8 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot @@ -21,7 +21,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -49,10 +49,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -270,8 +270,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:51968 -WORDPRESS_DOMAIN=localhost:51968 +WORDPRESS_URL=http://localhost:19501 +WORDPRESS_DOMAIN=localhost:19501 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -279,10 +280,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=51983 +CHROMEDRIVER_PORT=13899 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=51968 +BUILTIN_SERVER_PORT=19501 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot index a155e1b89..3eb25f223 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot @@ -21,7 +21,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -49,10 +49,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/_bootstrap.php >>> @@ -204,6 +204,7 @@ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. WORDPRESS_URL=http://wordpress.test WORDPRESS_DOMAIN=wordpress.test +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__0.snapshot.txt b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__0.snapshot.txt index 39a0c43b7..e12a62dea 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__0.snapshot.txt +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__0.snapshot.txt @@ -26,6 +26,8 @@ extensions: DB_ENGINE: sqlite DB_DIR: '%codecept_root_dir%/tests/Support/Data' DB_FILE: db.sqlite + WPBROWSER_SITEURL: '%WORDPRESS_URL%' + WPBROWSER_HOMEURL: '%WORDPRESS_URL%' commands: - lucatume\WPBrowser\Command\RunOriginal - lucatume\WPBrowser\Command\RunAll diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__1.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__1.snapshot index a2207738e..a808ee15b 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__1.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_single_site_correctly__1.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /EndToEnd.suite.yml <<< >>> /Integration/SampleTest.php >>> @@ -267,8 +267,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:52169 -WORDPRESS_DOMAIN=localhost:52169 +WORDPRESS_URL=http://localhost:26712 +WORDPRESS_DOMAIN=localhost:26712 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -276,10 +277,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=52182 +CHROMEDRIVER_PORT=12425 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=52169 +BUILTIN_SERVER_PORT=26712 <<< /.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_correctly__0.snapshot index d1dbc2fef..82c54f0aa 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_correctly__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -257,8 +257,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:7039 -WORDPRESS_DOMAIN=localhost:7039 +WORDPRESS_URL=http://localhost:61144 +WORDPRESS_DOMAIN=localhost:61144 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -266,10 +267,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=48529 +CHROMEDRIVER_PORT=17476 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=7039 +BUILTIN_SERVER_PORT=61144 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_custom_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_custom_correctly__0.snapshot index 328b5421a..6e8c18c1f 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_custom_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__should_scaffold_for_theme_custom_correctly__0.snapshot @@ -23,7 +23,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -51,10 +51,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/_bootstrap.php >>> @@ -206,6 +206,7 @@ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. WORDPRESS_URL=http://wordpress.test WORDPRESS_DOMAIN=wordpress.test +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin From 9ee6a006fc36c005a181268f6d13a778a8538aab Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Fri, 12 Apr 2024 12:11:14 +0200 Subject: [PATCH 2/2] doc(CHANGELOG.md) add changelog entry --- CHANGELOG.md | 4 ++++ ...scaffold_for_child_theme_correctly__0.snapshot | 15 ++++++++------- ..._scaffold_for_multi_site_correctly__0.snapshot | 15 ++++++++------- ...ffold_for_multi_site_correctly__0.snapshot.txt | 2 ++ ...or_plugin_with_non_plugin_php_file__0.snapshot | 15 ++++++++------- ...in_with_non_plugin_php_file_custom__0.snapshot | 15 ++++++++------- ...ld_for_plugin_with_plugin_php_file__0.snapshot | 15 ++++++++------- ...plugin_with_plugin_php_file_custom__0.snapshot | 15 ++++++++------- ...scaffold_for_single_site_correctly__0.snapshot | 15 ++++++++------- ...fold_for_single_site_correctly__0.snapshot.txt | 2 ++ ...hould_scaffold_for_theme_correctly__0.snapshot | 15 ++++++++------- ...caffold_for_theme_custom_correctly__0.snapshot | 15 ++++++++------- 12 files changed, 80 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e68744520..3a0431873 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [unreleased] Unreleased +### Changed + +- Fix non standard installation handling, hello Bedrock! (#716) + ## [3.5.6] 2024-04-07; ### Changed diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_child_theme_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_child_theme_correctly__0.snapshot index da3130e8e..a1ce62646 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_child_theme_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_child_theme_correctly__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -275,8 +275,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:35409 -WORDPRESS_DOMAIN=localhost:35409 +WORDPRESS_URL=http://localhost:55758 +WORDPRESS_DOMAIN=localhost:55758 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -284,10 +285,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=20606 +CHROMEDRIVER_PORT=3248 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=35409 +BUILTIN_SERVER_PORT=55758 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot index bdb555c17..eac8e55d0 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /EndToEnd.suite.yml <<< >>> /Integration/SampleTest.php >>> @@ -285,8 +285,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:37987 -WORDPRESS_DOMAIN=localhost:37987 +WORDPRESS_URL=http://localhost:62570 +WORDPRESS_DOMAIN=localhost:62570 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -294,10 +295,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=54870 +CHROMEDRIVER_PORT=44885 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=37987 +BUILTIN_SERVER_PORT=62570 <<< /.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot.txt b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot.txt index 257889de1..ac970dc8d 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot.txt +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_multi_site_correctly__0.snapshot.txt @@ -25,6 +25,8 @@ extensions: DB_ENGINE: sqlite DB_DIR: '%codecept_root_dir%/tests/_data' DB_FILE: db.sqlite + WPBROWSER_SITEURL: '%WORDPRESS_URL%' + WPBROWSER_HOMEURL: '%WORDPRESS_URL%' commands: - lucatume\WPBrowser\Command\RunOriginal - lucatume\WPBrowser\Command\RunAll diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot index 3ed482dee..7bd354a26 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -283,8 +283,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:18237 -WORDPRESS_DOMAIN=localhost:18237 +WORDPRESS_URL=http://localhost:36997 +WORDPRESS_DOMAIN=localhost:36997 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -292,10 +293,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=63427 +CHROMEDRIVER_PORT=56825 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=18237 +BUILTIN_SERVER_PORT=36997 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot index 6680ad076..68966a6b2 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_non_plugin_php_file_custom__0.snapshot @@ -21,7 +21,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -49,10 +49,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -288,8 +288,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:38047 -WORDPRESS_DOMAIN=localhost:38047 +WORDPRESS_URL=http://localhost:4967 +WORDPRESS_DOMAIN=localhost:4967 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -297,10 +298,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=56902 +CHROMEDRIVER_PORT=53508 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=38047 +BUILTIN_SERVER_PORT=4967 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot index ebd7ca348..a4a7206bb 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file__0.snapshot @@ -21,7 +21,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -49,10 +49,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -288,8 +288,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:18285 -WORDPRESS_DOMAIN=localhost:18285 +WORDPRESS_URL=http://localhost:58054 +WORDPRESS_DOMAIN=localhost:58054 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -297,10 +298,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=28492 +CHROMEDRIVER_PORT=38408 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=18285 +BUILTIN_SERVER_PORT=58054 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot index aaf4b93b6..7df24c708 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_plugin_with_plugin_php_file_custom__0.snapshot @@ -21,7 +21,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -49,10 +49,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -288,8 +288,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:20511 -WORDPRESS_DOMAIN=localhost:20511 +WORDPRESS_URL=http://localhost:2162 +WORDPRESS_DOMAIN=localhost:2162 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -297,10 +298,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=50604 +CHROMEDRIVER_PORT=18950 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=20511 +BUILTIN_SERVER_PORT=2162 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot index db38a7e4d..b7408b9e6 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /EndToEnd.suite.yml <<< >>> /Integration/SampleTest.php >>> @@ -285,8 +285,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:2607 -WORDPRESS_DOMAIN=localhost:2607 +WORDPRESS_URL=http://localhost:8865 +WORDPRESS_DOMAIN=localhost:8865 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -294,10 +295,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=10091 +CHROMEDRIVER_PORT=34174 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=2607 +BUILTIN_SERVER_PORT=8865 <<< /.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot.txt b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot.txt index 257889de1..ac970dc8d 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot.txt +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_single_site_correctly__0.snapshot.txt @@ -25,6 +25,8 @@ extensions: DB_ENGINE: sqlite DB_DIR: '%codecept_root_dir%/tests/_data' DB_FILE: db.sqlite + WPBROWSER_SITEURL: '%WORDPRESS_URL%' + WPBROWSER_HOMEURL: '%WORDPRESS_URL%' commands: - lucatume\WPBrowser\Command\RunOriginal - lucatume\WPBrowser\Command\RunAll diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_correctly__0.snapshot index d199383e1..6e94bc873 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_correctly__0.snapshot @@ -16,7 +16,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -44,10 +44,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -275,8 +275,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:37104 -WORDPRESS_DOMAIN=localhost:37104 +WORDPRESS_URL=http://localhost:8943 +WORDPRESS_DOMAIN=localhost:8943 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -284,10 +285,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=22645 +CHROMEDRIVER_PORT=7235 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=37104 +BUILTIN_SERVER_PORT=8943 <<< /tests/.env <<< diff --git a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_custom_correctly__0.snapshot b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_custom_correctly__0.snapshot index 88d046329..785764995 100644 --- a/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_custom_correctly__0.snapshot +++ b/tests/unit/Codeception/Template/__snapshots__/WpbrowserTest__3.5__should_scaffold_for_theme_custom_correctly__0.snapshot @@ -23,7 +23,7 @@ modules: url: '%WORDPRESS_URL%' adminUsername: '%WORDPRESS_ADMIN_USER%' adminPassword: '%WORDPRESS_ADMIN_PASSWORD%' - adminPath: '/wp-admin' + adminPath: '%WORDPRESS_ADMIN_PATH%' browser: chrome host: '%CHROMEDRIVER_HOST%' port: '%CHROMEDRIVER_PORT%' @@ -51,10 +51,10 @@ modules: wpRootFolder: '%WORDPRESS_ROOT_DIR%' lucatume\WPBrowser\Module\WPLoader: loadOnly: true - wpRootFolder: "%WORDPRESS_ROOT_DIR%" + wpRootFolder: '%WORDPRESS_ROOT_DIR%' dbUrl: '%WORDPRESS_DB_URL%' domain: '%WORDPRESS_DOMAIN%' - + <<< /tests/EndToEnd.suite.yml <<< >>> /tests/Integration/SampleTest.php >>> @@ -282,8 +282,9 @@ TEST_TABLE_PREFIX=test_ WORDPRESS_TABLE_PREFIX=wp_ # The URL and domain of the WordPress site used in end-to-end tests. -WORDPRESS_URL=http://localhost:11661 -WORDPRESS_DOMAIN=localhost:11661 +WORDPRESS_URL=http://localhost:64642 +WORDPRESS_DOMAIN=localhost:64642 +WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. WORDPRESS_ADMIN_USER=admin @@ -291,10 +292,10 @@ WORDPRESS_ADMIN_PASSWORD=password # The host and port of the ChromeDriver server that will be used in end-to-end tests. CHROMEDRIVER_HOST=localhost -CHROMEDRIVER_PORT=24165 +CHROMEDRIVER_PORT=32555 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=11661 +BUILTIN_SERVER_PORT=64642 <<< /tests/.env <<<