From d4e242b0282f4debadbd0bf5057e14a8af02e1e7 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Thu, 13 Jun 2019 15:40:02 -0600 Subject: [PATCH] Add test to catch missing version updates. --- .../tests/plugin-version.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plugins/woocommerce-admin/tests/plugin-version.php diff --git a/plugins/woocommerce-admin/tests/plugin-version.php b/plugins/woocommerce-admin/tests/plugin-version.php new file mode 100644 index 00000000000..b8bd2e89a33 --- /dev/null +++ b/plugins/woocommerce-admin/tests/plugin-version.php @@ -0,0 +1,34 @@ + 'Version' ) ); + + // Get plugin DB version. + $db_version = defined( 'WC_ADMIN_VERSION_NUMBER' ) ? constant( 'WC_ADMIN_VERSION_NUMBER' ) : false; + + // Compare all versions to the package.json value. + $this->assertEquals( $package->version, $plugin['Version'], 'Plugin header version does not match package.json' ); + $this->assertEquals( $package->version, $db_version, 'DB version constant does not match package.json' ); + } +}