Skip to content

Commit

Permalink
Merge pull request #253 from lucatume/release/2.2.12
Browse files Browse the repository at this point in the history
Release 2.2.12
  • Loading branch information
lucatume authored Jun 10, 2019
2 parents 2c79aa7 + 584b936 commit c495d5f
Show file tree
Hide file tree
Showing 25 changed files with 89 additions and 69 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased] Unreleased

## [2.2.12] 2019-06-10;
### Fixed
- make sure Cron is disabled while `WPLoader` module is installing WordPress in isolation (default mode)

## [2.2.11] 2019-06-06;
## Added
- support for `timeout` parameter in WPCLI module configuration
Expand Down Expand Up @@ -894,7 +898,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Reference to ModuleConfigException class in WPLoader class.

[unreleased]: https://github.com/lucatume/wp-browser/compare/2.2.11...HEAD
[unreleased]: https://github.com/lucatume/wp-browser/compare/2.2.12...HEAD
[2.2.12]: https://github.com/lucatume/wp-browser/compare/2.2.11...2.2.12:
[2.2.11]: https://github.com/lucatume/wp-browser/compare/2.2.10...2.2.11:
[2.2.10]: https://github.com/lucatume/wp-browser/compare/2.2.9...2.2.10
[2.2.9]: https://github.com/lucatume/wp-browser/compare/2.2.8...2.2.9
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"wp-cli/wp-cli-bundle": ">=2.0 <3.0.0"
},
"require-dev": {
"phpunit/phpunit": "<8.2.0",
"erusev/parsedown": "^1.7",
"lucatume/codeception-snapshot-assertions": "^0.2",
"mikey179/vfsstream": "^1.6",
Expand Down
10 changes: 9 additions & 1 deletion src/includes/isolated-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function wpbrowser_write_patchwork_config(array $configuration) {

$multisite = !empty($argv[2]) ? $argv[2] : false;


// require_once 'vendor/autoload.php';
require_once $configuration['autoload'];

Expand All @@ -80,6 +79,15 @@ function wpbrowser_write_patchwork_config(array $configuration) {
$activePlugins = [];
}

// If Cron is not disable it's disabled here.
if ( ! isset( $configuration['constants']['DISABLE_WP_CRON'] ) ) {
print( "Disabling cron\n" );
$configuration['constants']['DISABLE_WP_CRON'] = true;
} else {
$enabled = DISABLE_WP_CRON ? 'yes' : 'no';
print( "Cron disabled (via 'DISABLE_WP_CRON' constant): {$enabled}\n" );
}

printf("\nConfiguration:\n\n%s\n\n", json_encode($configuration, JSON_PRETTY_PRINT));

foreach ($configuration['constants'] as $key => $value) {
Expand Down
3 changes: 2 additions & 1 deletion src/tad/WPBrowser/Module/Support/WPHealthcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ protected function getConstants()
'DB_PASSWORD' => $this->constants->constant('DB_PASSWORD', 'not set'),
'DB_USER' => $this->constants->constant('DB_USER', 'not set'),
'CUSTOM_USER_TABLE' => $this->constants->constant('CUSTOM_USER_TABLE', 'not set'),
'CUSTOM_USER_META_TABLE' => $this->constants->constant('CUSTOM_USER_META_TABLE', 'not set')
'CUSTOM_USER_META_TABLE' => $this->constants->constant('CUSTOM_USER_META_TABLE', 'not set'),
'DISABLE_WP_CRON' => $this->constants->constant('DISABLE_WP_CRON', 'not set')
];
}

Expand Down
59 changes: 16 additions & 43 deletions tests/_data/dump.sql

Large diffs are not rendered by default.

Empty file modified tests/_data/empty/.gitignore
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "not set",
"DB_USER": "not set",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_ (guessed, global not set)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_ (guessed, global not set)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "not_existing_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
},
"checks": {
"Site is multisite": "no",
"ABSPATH points to valid WordPress directory": "Yes, wp-load.php file found in WordPress root directory.",
"Database connection works": "No, connection errors: SQLSTATE[HY000] [1049] Unknown database 'empty'",
"Database structure as expected": "No, structure errors: cannot connect to database to check structure.",
"Blog installed": "No, blog is not installed: cannot connect to database to check if blog is installed.",
"Theme :": "Cannot connect to database to check for current theme.",
"Database connection works": "Yes, connection successful.",
"Database structure as expected": "No, structure errors: no tables found in database.",
"Blog installed": "No, blog is not installed: database table [wp_options] does not contain a 'siteurl' option.",
"Theme :": "Cannot find the 'template' option in the database.",
"Must-use plugins health-check:": "mu-plugins directory(wp-content/mu-plugins) does not exist.",
"Plugins health-check:": "Cannot connect to database to check on plugins."
"Plugins health-check:": "The 'active_plugins' option was not found in the database . "
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "not set",
"DB_USER": "not set",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_ (guessed, global not set)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"DB_PASSWORD": "",
"DB_USER": "root",
"CUSTOM_USER_TABLE": "not set",
"CUSTOM_USER_META_TABLE": "not set"
"CUSTOM_USER_META_TABLE": "not set",
"DISABLE_WP_CRON": "not set"
},
"globals": {
"table_prefix": "wp_"
Expand Down
14 changes: 14 additions & 0 deletions tests/wploadersuite/CronDeactivationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

class CronDeactivationTest extends \Codeception\TestCase\WPTestCase
{
/**
* It should disable CRON by default
*
* @test
*/
public function should_disable_cron_by_default()
{
$this->assertEquals(true, (bool)DISABLE_WP_CRON);
}
}

0 comments on commit c495d5f

Please sign in to comment.