diff --git a/CHANGELOG.md b/CHANGELOG.md index 23b73a504..81ca3d825 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. + ## [4.2.4] 2024-06-06; ### Added diff --git a/composer.json b/composer.json index fac292a68..aaff6ca95 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,8 @@ }, "autoload-dev": { "psr-4": { - "lucatume\\WPBrowser\\Tests\\": "tests/_support", + "lucatume\\WPBrowser\\Tests\\FSTemplates\\": "tests/_support/FSTemplates", + "lucatume\\WPBrowser\\Tests\\Traits\\": "tests/_support/Traits", "lucatume\\Rector\\": "config/rector/src" } }, diff --git a/src/Project/ContentProject.php b/src/Project/ContentProject.php index f635e4eda..28ebdde44 100644 --- a/src/Project/ContentProject.php +++ b/src/Project/ContentProject.php @@ -115,16 +115,12 @@ public function setup(): void EOT; - $symlinkerConfig = [ - 'wpRootFolder' => '%WORDPRESS_ROOT_DIR%', - 'plugins' => [], - 'themes' => [] - ]; + $symlinkerConfig = [ 'wpRootFolder' => '%WORDPRESS_ROOT_DIR%' ]; if ($this instanceof PluginProject) { - $symlinkerConfig['plugins'][] = '.'; + $symlinkerConfig['plugins'] = ['.']; } elseif ($this instanceof ThemeProject) { - $symlinkerConfig['themes'][] = '.'; + $symlinkerConfig['themes'] = ['.']; } $this->testEnvironment->extensionsEnabled = [ diff --git a/src/Template/Wpbrowser.php b/src/Template/Wpbrowser.php index 84dfafcd9..99e3db8ed 100644 --- a/src/Template/Wpbrowser.php +++ b/src/Template/Wpbrowser.php @@ -295,13 +295,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 731d53ecb..1e2b0d88b 100644 --- a/src/WordPress/Database/SQLiteDatabase.php +++ b/src/WordPress/Database/SQLiteDatabase.php @@ -255,7 +255,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_%';"); @@ -270,7 +270,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) { @@ -308,6 +308,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__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 644e13d3b..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:32347 -WORDPRESS_DOMAIN=localhost:32347 +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=59028 +CHROMEDRIVER_PORT=43956 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=32347 +BUILTIN_SERVER_PORT=8970 <<< /tests/.env <<< @@ -325,7 +327,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__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 dc1230795..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:48989 -WORDPRESS_DOMAIN=localhost:48989 +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=10540 +CHROMEDRIVER_PORT=55678 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=48989 +BUILTIN_SERVER_PORT=27090 <<< /tests/.env <<< @@ -322,7 +324,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__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 745075eca..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:51713 -WORDPRESS_DOMAIN=localhost:51713 +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=41985 +CHROMEDRIVER_PORT=53682 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=51713 +BUILTIN_SERVER_PORT=45130 <<< /tests/.env <<< @@ -327,7 +329,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__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 b8056a07b..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:10603 -WORDPRESS_DOMAIN=localhost:10603 +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=43861 +CHROMEDRIVER_PORT=26026 # The port on which the PHP built-in server will serve the WordPress installation. -BUILTIN_SERVER_PORT=10603 +BUILTIN_SERVER_PORT=32075 <<< /tests/.env <<< @@ -325,7 +327,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__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 <<<