From 8d1116c49cf23d88ef33a8d176fe157e8977a7fa Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Tue, 25 Jun 2024 10:56:13 +0200 Subject: [PATCH 1/4] fix(setup template) remove error from bootstrap file, clean up dump --- src/Project/ContentProject.php | 6 +-- src/Template/Wpbrowser.php | 14 ++++--- src/WordPress/Database/SQLiteDatabase.php | 6 ++- ...fold_for_child_theme_correctly__0.snapshot | 23 +++++++----- ...ffold_for_multi_site_correctly__0.snapshot | 22 ++++++----- ...lugin_with_non_plugin_php_file__0.snapshot | 23 +++++++----- ...ith_non_plugin_php_file_custom__0.snapshot | 23 +++++++----- ...or_plugin_with_plugin_php_file__0.snapshot | 23 +++++++----- ...in_with_plugin_php_file_custom__0.snapshot | 23 +++++++----- ...fold_for_single_site_correctly__0.snapshot | 22 ++++++----- ...d_scaffold_for_theme_correctly__0.snapshot | 23 +++++++----- ...old_for_theme_custom_correctly__0.snapshot | 23 +++++++----- ...ite_with_non_default_structure__0.snapshot | 14 ++++--- ...re_using_default_configuration__0.snapshot | 22 ++++++----- ...fold_for_child_theme_correctly__0.snapshot | 22 ++++++----- ...ffold_for_multi_site_correctly__1.snapshot | 22 ++++++----- ...lugin_with_non_plugin_php_file__0.snapshot | 22 ++++++----- ...ith_non_plugin_php_file_custom__0.snapshot | 14 ++++--- ...or_plugin_with_plugin_php_file__0.snapshot | 22 ++++++----- ...in_with_plugin_php_file_custom__0.snapshot | 14 ++++--- ...fold_for_single_site_correctly__1.snapshot | 22 ++++++----- ...d_scaffold_for_theme_correctly__0.snapshot | 22 ++++++----- ...old_for_theme_custom_correctly__0.snapshot | 14 ++++--- .../WPBrowser/Extension/SymlinkerTest.php | 37 ++++++++++--------- 24 files changed, 264 insertions(+), 214 deletions(-) diff --git a/src/Project/ContentProject.php b/src/Project/ContentProject.php index e4e7a81b7..0c021b9a7 100644 --- a/src/Project/ContentProject.php +++ b/src/Project/ContentProject.php @@ -118,12 +118,10 @@ public function setup(): void EOT; - $symlinkerConfig = [ - 'wpRootFolder' => '%WORDPRESS_ROOT_DIR%' - ]; + $symlinkerConfig = [ 'wpRootFolder' => '%WORDPRESS_ROOT_DIR%' ]; if ($this instanceof PluginProject) { - $symlinkerConfig['plugins']= ['.']; + $symlinkerConfig['plugins'] = ['.']; } elseif ($this instanceof ThemeProject) { $symlinkerConfig['themes'] = ['.']; } diff --git a/src/Template/Wpbrowser.php b/src/Template/Wpbrowser.php index c751018ff..b1a046db3 100644 --- a/src/Template/Wpbrowser.php +++ b/src/Template/Wpbrowser.php @@ -292,13 +292,15 @@ private function createEndToEndSuite(ProjectInterface $project): void * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ EOF; $bootstrapPathname = $this->workDir . '/tests/EndToEnd/_bootstrap.php'; diff --git a/src/WordPress/Database/SQLiteDatabase.php b/src/WordPress/Database/SQLiteDatabase.php index ffd271c09..42872b22f 100644 --- a/src/WordPress/Database/SQLiteDatabase.php +++ b/src/WordPress/Database/SQLiteDatabase.php @@ -278,7 +278,7 @@ public function dump(string $dumpFilePath): void $db = new SQLite3($this->dbPathname); $db->busyTimeout(5000); - $sql = ""; + $sql = "PRAGMA foreign_keys = OFF;\n\n"; $tables = $db->query("SELECT name FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%';"); @@ -293,7 +293,7 @@ public function dump(string $dumpFilePath): void throw new DbException("Could not read table $table[0] from database.", DbException::FAILED_DUMP); } - $sql .= $tableSql . ";\n\n"; + $sql .= "DROP TABLE IF EXISTS $table[0];\n" . $tableSql . ";\n\n"; $rows = $db->query("SELECT * FROM $table[0]"); if ($rows === false) { @@ -331,6 +331,8 @@ public function dump(string $dumpFilePath): void $sql = rtrim($sql, ",") . ";\n\n"; } + $sql .= "PRAGMA foreign_keys = ON\n"; + if (file_put_contents($dumpFilePath, $sql) === false) { throw new DbException("Could not write dump file $dumpFilePath.", DbException::FAILED_DUMP); } 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 81e2e41b4..7fc176880 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 @@ -240,13 +240,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -288,8 +290,8 @@ 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:63999 -WORDPRESS_DOMAIN=localhost:63999 +WORDPRESS_URL=http://localhost:61155 +WORDPRESS_DOMAIN=localhost:61155 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -298,10 +300,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=30951 +CHROMEDRIVER_PORT=51523 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=63999 +BUILTIN_SERVER_PORT=61155 <<< /tests/.env <<< @@ -344,6 +346,7 @@ extensions: DB_FILE: db.sqlite lucatume\WPBrowser\Extension\Symlinker: wpRootFolder: '%WORDPRESS_ROOT_DIR%' + plugins: { } themes: - . commands: 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 eac8e55d0..005010b83 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 @@ -232,13 +232,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /EndToEnd/_bootstrap.php <<< @@ -285,8 +287,8 @@ 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:62570 -WORDPRESS_DOMAIN=localhost:62570 +WORDPRESS_URL=http://localhost:62040 +WORDPRESS_DOMAIN=localhost:62040 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -295,10 +297,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=44885 +CHROMEDRIVER_PORT=5257 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=62570 +BUILTIN_SERVER_PORT=62040 <<< /.env <<< 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 d8aedb893..a51e767f6 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 @@ -227,13 +227,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -283,8 +285,8 @@ 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:22914 -WORDPRESS_DOMAIN=localhost:22914 +WORDPRESS_URL=http://localhost:57159 +WORDPRESS_DOMAIN=localhost:57159 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -293,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=60583 +CHROMEDRIVER_PORT=64665 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=22914 +BUILTIN_SERVER_PORT=57159 <<< /tests/.env <<< @@ -341,6 +343,7 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . + themes: { } 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_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 066209993..78888017f 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 @@ -232,13 +232,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -288,8 +290,8 @@ 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:38154 -WORDPRESS_DOMAIN=localhost:38154 +WORDPRESS_URL=http://localhost:54488 +WORDPRESS_DOMAIN=localhost:54488 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -298,10 +300,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=38622 +CHROMEDRIVER_PORT=2810 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=38154 +BUILTIN_SERVER_PORT=54488 <<< /tests/.env <<< @@ -346,6 +348,7 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . + themes: { } 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_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 8a8a139c6..c3b58f869 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 @@ -232,13 +232,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -288,8 +290,8 @@ 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:24475 -WORDPRESS_DOMAIN=localhost:24475 +WORDPRESS_URL=http://localhost:10806 +WORDPRESS_DOMAIN=localhost:10806 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -298,10 +300,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=34217 +CHROMEDRIVER_PORT=20430 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=24475 +BUILTIN_SERVER_PORT=10806 <<< /tests/.env <<< @@ -346,6 +348,7 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . + themes: { } 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_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 e33f0981e..28d9288db 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 @@ -232,13 +232,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -288,8 +290,8 @@ 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:37136 -WORDPRESS_DOMAIN=localhost:37136 +WORDPRESS_URL=http://localhost:15573 +WORDPRESS_DOMAIN=localhost:15573 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -298,10 +300,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=28671 +CHROMEDRIVER_PORT=37131 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=37136 +BUILTIN_SERVER_PORT=15573 <<< /tests/.env <<< @@ -346,6 +348,7 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . + themes: { } commands: - lucatume\WPBrowser\Command\RunOriginal - lucatume\WPBrowser\Command\RunAll 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 b7408b9e6..aec1fc63c 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 @@ -232,13 +232,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /EndToEnd/_bootstrap.php <<< @@ -285,8 +287,8 @@ 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:8865 -WORDPRESS_DOMAIN=localhost:8865 +WORDPRESS_URL=http://localhost:9756 +WORDPRESS_DOMAIN=localhost:9756 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -295,10 +297,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=34174 +CHROMEDRIVER_PORT=64657 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=8865 +BUILTIN_SERVER_PORT=9756 <<< /.env <<< 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 ea45b007c..a587ec43f 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 @@ -240,13 +240,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -288,8 +290,8 @@ 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:64427 -WORDPRESS_DOMAIN=localhost:64427 +WORDPRESS_URL=http://localhost:49454 +WORDPRESS_DOMAIN=localhost:49454 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -298,10 +300,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=63617 +CHROMEDRIVER_PORT=57976 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=64427 +BUILTIN_SERVER_PORT=49454 <<< /tests/.env <<< @@ -344,6 +346,7 @@ extensions: DB_FILE: db.sqlite lucatume\WPBrowser\Extension\Symlinker: wpRootFolder: '%WORDPRESS_ROOT_DIR%' + plugins: { } themes: - . commands: 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 cbd8d6bf3..33f69fd06 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 @@ -247,13 +247,15 @@ modules: * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -295,8 +297,8 @@ 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:60239 -WORDPRESS_DOMAIN=localhost:60239 +WORDPRESS_URL=http://localhost:7073 +WORDPRESS_DOMAIN=localhost:7073 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -305,10 +307,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=34925 +CHROMEDRIVER_PORT=19582 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=60239 +BUILTIN_SERVER_PORT=7073 <<< /tests/.env <<< @@ -351,6 +353,7 @@ extensions: DB_FILE: db.sqlite lucatume\WPBrowser\Extension\Symlinker: wpRootFolder: '%WORDPRESS_ROOT_DIR%' + plugins: { } themes: - . commands: 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 680e49321..1103fec01 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 @@ -169,13 +169,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /EndToEnd/_bootstrap.php <<< 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 index 62ce0a039..8f1dd2d72 100644 --- 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 @@ -214,13 +214,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /EndToEnd/_bootstrap.php <<< @@ -267,8 +269,8 @@ 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:24423 -WORDPRESS_DOMAIN=localhost:24423 +WORDPRESS_URL=http://localhost:28388 +WORDPRESS_DOMAIN=localhost:28388 WORDPRESS_ADMIN_PATH=/wp/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -277,10 +279,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=17558 +CHROMEDRIVER_PORT=9649 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=24423 +BUILTIN_SERVER_PORT=28388 # The path to the directory that should be served on localhost, the one containing the wp-config.php file. WORDPRESS_DOCROOT=web 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 a1393bdea..a400b43d1 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 @@ -222,13 +222,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -270,8 +272,8 @@ 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:44604 -WORDPRESS_DOMAIN=localhost:44604 +WORDPRESS_URL=http://localhost:8970 +WORDPRESS_DOMAIN=localhost:8970 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -280,10 +282,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=48635 +CHROMEDRIVER_PORT=43956 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=44604 +BUILTIN_SERVER_PORT=8970 <<< /tests/.env <<< 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 39177ae30..e72485b1a 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 @@ -214,13 +214,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /EndToEnd/_bootstrap.php <<< @@ -267,8 +269,8 @@ 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:9035 -WORDPRESS_DOMAIN=localhost:9035 +WORDPRESS_URL=http://localhost:14644 +WORDPRESS_DOMAIN=localhost:14644 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -277,10 +279,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=21043 +CHROMEDRIVER_PORT=17240 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=9035 +BUILTIN_SERVER_PORT=14644 <<< /.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 ac20062ee..b48a1b4d4 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 @@ -209,13 +209,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -265,8 +267,8 @@ 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:15609 -WORDPRESS_DOMAIN=localhost:15609 +WORDPRESS_URL=http://localhost:27090 +WORDPRESS_DOMAIN=localhost:27090 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -275,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=1350 +CHROMEDRIVER_PORT=55678 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=15609 +BUILTIN_SERVER_PORT=27090 <<< /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 77f9d15dd..83c61685d 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 @@ -174,13 +174,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< 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 9eba0b90b..84bb022ec 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 @@ -214,13 +214,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -270,8 +272,8 @@ 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:45720 -WORDPRESS_DOMAIN=localhost:45720 +WORDPRESS_URL=http://localhost:45130 +WORDPRESS_DOMAIN=localhost:45130 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -280,10 +282,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=26087 +CHROMEDRIVER_PORT=53682 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=45720 +BUILTIN_SERVER_PORT=45130 <<< /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 0734db2f2..82587e8b3 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 @@ -174,13 +174,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< 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 a808ee15b..81186b3b8 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 @@ -214,13 +214,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /EndToEnd/_bootstrap.php <<< @@ -267,8 +269,8 @@ 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:26712 -WORDPRESS_DOMAIN=localhost:26712 +WORDPRESS_URL=http://localhost:23271 +WORDPRESS_DOMAIN=localhost:23271 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -277,10 +279,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=12425 +CHROMEDRIVER_PORT=45511 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=26712 +BUILTIN_SERVER_PORT=23271 <<< /.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 0d368687f..f489b8c62 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 @@ -222,13 +222,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< @@ -270,8 +272,8 @@ 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:16359 -WORDPRESS_DOMAIN=localhost:16359 +WORDPRESS_URL=http://localhost:32075 +WORDPRESS_DOMAIN=localhost:32075 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -280,10 +282,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=13552 +CHROMEDRIVER_PORT=26026 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=16359 +BUILTIN_SERVER_PORT=32075 <<< /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 6cee5d442..adb4948b8 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 @@ -189,13 +189,15 @@ class EndToEndTester extends \Codeception\Actor * "modules.config.WPDb.dump" setting in the suite configuration file. The database will be dropped after each test * and re-created from the dump file(s). * - * You can modify and create new dump files using the `vendor/bin/codecept wp:cli EndToEnd ` command - * to run WP-CLI commands on the WordPress site and database used by the EndToEnd suite. + * You can modify and create new dump files using WP-CLI or by operating directly on the WordPress site and database, + * use the `vendor/bin/codecept dev:info` command to know the URL to the WordPress site. + * Note that WP-CLI will not natively handle SQLite databases, so you will need to use the `wp:db:import` and + * `wp:db:export` commands to import and export the database. * 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. + * `vendor/bin/codecept wp:db:import tests/_wordpress tests/Support/Data/dump.sql` to load dump file. + * `wp --path=tests/_wordpress plugin activate woocommerce` to activate the WooCommerce plugin. + * `wp --path=tests/_wordpress user create alice alice@example.com --role=administrator` to create a new user. + * `vendor/bin/codecept wp:db:export tests/_wordpress tests/Support/Data/dump.sql` to update the dump file. */ <<< /tests/EndToEnd/_bootstrap.php <<< diff --git a/tests/unit/lucatume/WPBrowser/Extension/SymlinkerTest.php b/tests/unit/lucatume/WPBrowser/Extension/SymlinkerTest.php index 98b5387f4..e9c41c41c 100644 --- a/tests/unit/lucatume/WPBrowser/Extension/SymlinkerTest.php +++ b/tests/unit/lucatume/WPBrowser/Extension/SymlinkerTest.php @@ -10,7 +10,6 @@ use Codeception\Test\Unit; use lucatume\WPBrowser\Extension\Symlinker; use lucatume\WPBrowser\Tests\Traits\LoopIsolation; -use lucatume\WPBrowser\Utils\Codeception; use lucatume\WPBrowser\Utils\Filesystem as FS; use lucatume\WPBrowser\WordPress\Installation; use PHPUnit\Framework\Assert; @@ -20,6 +19,16 @@ class SymlinkerTest extends Unit { use LoopIsolation; + private function getSuiteEvent(): SuiteEvent + { + if (Codecept::VERSION >= 5) { + return new SuiteEvent(new Suite(new EventDispatcher(), 'test')); + } + + // Codeception 4.x. + return new SuiteEvent(new Suite()); + } + public function test_exists(): void { $symlinker = new Symlinker([ @@ -33,20 +42,11 @@ public function test_throw_if_wp_root_folder_is_not_set(): void { $this->expectException(ModuleConfigException::class); $this->expectExceptionMessage('The `wpRootFolder` configuration parameter must be set.'); + $suiteEvent = $this->getSuiteEvent(); $symlinker = new Symlinker([ ], []); - $symlinker->onModuleInit($this->getSuiteEvent()); - } - - private function getSuiteEvent(): SuiteEvent - { - if (Codecept::VERSION >= 5) { - return new SuiteEvent(new Suite(new EventDispatcher(), 'test')); - } - - // Codeception 4.x. - return new SuiteEvent(new Suite()); + $symlinker->onModuleInit($suiteEvent); } public function test_throw_if_wp_root_folder_does_not_point_to_a_valid_installation(): void @@ -54,10 +54,10 @@ public function test_throw_if_wp_root_folder_does_not_point_to_a_valid_installat $symlinker = new Symlinker([ 'wpRootFolder' => __DIR__, ], []); + $suiteEvent = $this->getSuiteEvent(); $this->expectException(ModuleConfigException::class); $this->expectExceptionMessage('The `wpRootFolder` does not point to a valid WordPress installation.'); - $suiteEvent = $this->getSuiteEvent(); $this->assertInIsolation(static function () use ($symlinker, $suiteEvent) { $symlinker->onModuleInit($suiteEvent); @@ -68,24 +68,26 @@ public function test_throw_if_plugins_are_not_array(): void { $this->expectException(ModuleConfigException::class); $this->expectExceptionMessage('The `plugins` configuration parameter must be an array.'); + $suiteEvent = $this->getSuiteEvent(); $symlinker = new Symlinker([ 'wpRootFolder' => __DIR__, 'plugins' => 'not-an-array', ], []); - $symlinker->onModuleInit($this->getSuiteEvent()); + $symlinker->onModuleInit($suiteEvent); } public function test_throw_if_themes_are_not_array(): void { $this->expectException(ModuleConfigException::class); $this->expectExceptionMessage('The `themes` configuration parameter must be an array.'); + $suiteEvent = $this->getSuiteEvent(); $symlinker = new Symlinker([ 'wpRootFolder' => __DIR__, 'themes' => 'not-an-array', ], []); - $symlinker->onModuleInit($this->getSuiteEvent()); + $symlinker->onModuleInit($suiteEvent); } public function test_without_plugins_or_themes(): void @@ -93,12 +95,12 @@ public function test_without_plugins_or_themes(): void $workingDir = FS::tmpDir('symlinker_'); $wpRoot = FS::tmpDir('symlinker_'); Installation::scaffold($wpRoot); + $suiteEvent = $this->getSuiteEvent(); $symlinker = new Symlinker([ 'wpRootFolder' => $wpRoot, ], []); - $suiteEvent = $this->getSuiteEvent(); $this->assertInIsolation(static function () use ($symlinker, $workingDir, $suiteEvent) { chdir($workingDir); @@ -121,7 +123,6 @@ public function test_throws_if_plugin_file_does_not_exist(): void $this->expectException(ModuleConfigException::class); $this->expectExceptionMessage('Plugin file not-a-file/plugin.php does not exist.'); - $symlinker = new Symlinker([ 'wpRootFolder' => $wpRoot, 'plugins' => [ @@ -723,7 +724,7 @@ function theme_2_some_function() { Installation::scaffold($wpRoot); $suiteEvent = $this->getSuiteEvent(); - $this->assertInIsolation(static function () use ($workingDir, $wpRoot,$suiteEvent) { + $this->assertInIsolation(static function () use ($workingDir, $wpRoot, $suiteEvent) { chdir($workingDir); Assert::assertSame($workingDir, getcwd()); From 1a3df9bb457b0d9266d1308e5e8028a0a1f8abed Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 26 Jun 2024 08:29:02 +0200 Subject: [PATCH 2/4] build(composer.json) fix strict PSR requirements --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 290b54a65..067e7db15 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,8 @@ }, "autoload-dev": { "psr-4": { - "lucatume\\WPBrowser\\Tests\\": "tests/_support" + "lucatume\\WPBrowser\\Tests\\FSTemplates\\": "tests/_support/FSTemplates", + "lucatume\\WPBrowser\\Tests\\Traits\\": "tests/_support/Traits" } }, "extra": { From bb71fa4f557134d021150447b2bbeaccd968ed86 Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 26 Jun 2024 08:45:22 +0200 Subject: [PATCH 3/4] test(unit) update snapshots --- ...should_scaffold_for_child_theme_correctly__0.snapshot | 9 ++++----- ...ffold_for_plugin_with_non_plugin_php_file__0.snapshot | 9 ++++----- ...or_plugin_with_non_plugin_php_file_custom__0.snapshot | 9 ++++----- ..._scaffold_for_plugin_with_plugin_php_file__0.snapshot | 9 ++++----- ...ld_for_plugin_with_plugin_php_file_custom__0.snapshot | 9 ++++----- ..._3.5__should_scaffold_for_theme_correctly__0.snapshot | 9 ++++----- ...hould_scaffold_for_theme_custom_correctly__0.snapshot | 9 ++++----- 7 files changed, 28 insertions(+), 35 deletions(-) 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 7fc176880..c7b3a3b62 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 @@ -290,8 +290,8 @@ 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:61155 -WORDPRESS_DOMAIN=localhost:61155 +WORDPRESS_URL=http://localhost:33117 +WORDPRESS_DOMAIN=localhost:33117 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -300,10 +300,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=51523 +CHROMEDRIVER_PORT=45469 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=61155 +BUILTIN_SERVER_PORT=33117 <<< /tests/.env <<< @@ -346,7 +346,6 @@ extensions: DB_FILE: db.sqlite lucatume\WPBrowser\Extension\Symlinker: wpRootFolder: '%WORDPRESS_ROOT_DIR%' - plugins: { } themes: - . commands: 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 a51e767f6..0b0110fb3 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 @@ -285,8 +285,8 @@ 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:57159 -WORDPRESS_DOMAIN=localhost:57159 +WORDPRESS_URL=http://localhost:46881 +WORDPRESS_DOMAIN=localhost:46881 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -295,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=64665 +CHROMEDRIVER_PORT=7413 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=57159 +BUILTIN_SERVER_PORT=46881 <<< /tests/.env <<< @@ -343,7 +343,6 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . - themes: { } 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_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 78888017f..7b1fca505 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 @@ -290,8 +290,8 @@ 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:54488 -WORDPRESS_DOMAIN=localhost:54488 +WORDPRESS_URL=http://localhost:9943 +WORDPRESS_DOMAIN=localhost:9943 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -300,10 +300,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=2810 +CHROMEDRIVER_PORT=28657 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=54488 +BUILTIN_SERVER_PORT=9943 <<< /tests/.env <<< @@ -348,7 +348,6 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . - themes: { } 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_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 c3b58f869..ff317eccf 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 @@ -290,8 +290,8 @@ 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:10806 -WORDPRESS_DOMAIN=localhost:10806 +WORDPRESS_URL=http://localhost:33246 +WORDPRESS_DOMAIN=localhost:33246 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -300,10 +300,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=20430 +CHROMEDRIVER_PORT=45155 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=10806 +BUILTIN_SERVER_PORT=33246 <<< /tests/.env <<< @@ -348,7 +348,6 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . - themes: { } 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_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 28d9288db..f9ce679a8 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 @@ -290,8 +290,8 @@ 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:15573 -WORDPRESS_DOMAIN=localhost:15573 +WORDPRESS_URL=http://localhost:46181 +WORDPRESS_DOMAIN=localhost:46181 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -300,10 +300,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=37131 +CHROMEDRIVER_PORT=37285 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=15573 +BUILTIN_SERVER_PORT=46181 <<< /tests/.env <<< @@ -348,7 +348,6 @@ extensions: wpRootFolder: '%WORDPRESS_ROOT_DIR%' plugins: - . - themes: { } 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 a587ec43f..7f9ff2440 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 @@ -290,8 +290,8 @@ 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:49454 -WORDPRESS_DOMAIN=localhost:49454 +WORDPRESS_URL=http://localhost:39492 +WORDPRESS_DOMAIN=localhost:39492 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -300,10 +300,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=57976 +CHROMEDRIVER_PORT=1155 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=49454 +BUILTIN_SERVER_PORT=39492 <<< /tests/.env <<< @@ -346,7 +346,6 @@ extensions: DB_FILE: db.sqlite lucatume\WPBrowser\Extension\Symlinker: wpRootFolder: '%WORDPRESS_ROOT_DIR%' - plugins: { } themes: - . commands: 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 33f69fd06..f2ce34f86 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 @@ -297,8 +297,8 @@ 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:7073 -WORDPRESS_DOMAIN=localhost:7073 +WORDPRESS_URL=http://localhost:46168 +WORDPRESS_DOMAIN=localhost:46168 WORDPRESS_ADMIN_PATH=/wp-admin # The username and password of the administrator user of the WordPress site used in end-to-end tests. @@ -307,10 +307,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=19582 +CHROMEDRIVER_PORT=44127 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=7073 +BUILTIN_SERVER_PORT=46168 <<< /tests/.env <<< @@ -353,7 +353,6 @@ extensions: DB_FILE: db.sqlite lucatume\WPBrowser\Extension\Symlinker: wpRootFolder: '%WORDPRESS_ROOT_DIR%' - plugins: { } themes: - . commands: From 41bdd4eb428c44aa957c4354d8d86bd4b5e26a7c Mon Sep 17 00:00:00 2001 From: Luca Tumedei Date: Wed, 26 Jun 2024 09:00:03 +0200 Subject: [PATCH 4/4] doc(CHANGELOG.md) add missing update entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 488daef9a..3cba8d161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [unreleased] Unreleased +### Changed + +- Updated documentation entry in EndToEnd suite bootstrap file. + ## [3.6.4] 2024-06-06; ### Added