Skip to content

Cleaning up codebase (WIP) #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "skyverge/wc-plugin-framework",
"description": "The official SkyVerge WooCommerce plugin framework",
"version": "5.15.3",
"version": "5.15.4",
"license": "GPL-3.0",
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down Expand Up @@ -35,12 +35,12 @@
"woocommerce/class-sv-wp-admin-message-handler.php"
],
"psr-4": {
"SkyVerge\\WooCommerce\\PluginFramework\\v5_15_3\\": "woocommerce/"
"SkyVerge\\WooCommerce\\PluginFramework\\v5_15_4\\": "woocommerce/"
}
},
"autoload-dev": {
"psr-4": {
"SkyVerge\\WooCommerce\\PluginFramework\\v5_15_3\\Tests\\": "tests/"
"SkyVerge\\WooCommerce\\PluginFramework\\v5_15_4\\Tests\\": "tests/"
}
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wc-plugin-framework",
"version": "5.15.3",
"version": "5.15.4",
"title": "WooCommerce Plugin Framework",
"author": "SkyVerge Team",
"homepage": "https://github.com/skyverge/wc-plugin-framework#readme",
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SkyVerge\WooCommerce\PluginFramework\v5_15_3\Tests;
namespace SkyVerge\WooCommerce\PluginFramework\v5_15_4\Tests;

use WP_Mock\Tools\TestCase as WpMockTestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SkyVerge\WooCommerce\GatewayTestPlugin;

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

defined( 'ABSPATH' ) or exit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace SkyVerge\WooCommerce\GatewayTestPlugin;

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

defined( 'ABSPATH' ) or exit;

Expand Down
18 changes: 9 additions & 9 deletions tests/_support/plugins/gateway-test-plugin/includes/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace SkyVerge\WooCommerce\GatewayTestPlugin;

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

defined( 'ABSPATH' ) or exit;

Expand Down Expand Up @@ -46,26 +46,26 @@ public function __construct() {
}


public function get_documentation_url() {

public function get_documentation_url() : ?string
{
return 'https://example.com';
}


public function get_settings_url( $plugin_id = null ) {

public function get_settings_url( string $plugin_id = null ) : string
{
return admin_url( 'admin.php?page=wc-settings' );
}


public function get_plugin_name() {

public function get_plugin_name() : string
{
return 'Framework Gateway Test Plugin';
}


protected function get_file() {

protected function get_file() : string
{
return __DIR__;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/_support/plugins/test-plugin/includes/API.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace SkyVerge\WooCommerce\TestPlugin;

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

defined( 'ABSPATH' ) or exit;

Expand Down
2 changes: 1 addition & 1 deletion tests/_support/plugins/test-plugin/includes/Gateway.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace SkyVerge\WooCommerce\TestPlugin;

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

defined( 'ABSPATH' ) or exit;

Expand Down
18 changes: 9 additions & 9 deletions tests/_support/plugins/test-plugin/includes/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace SkyVerge\WooCommerce\TestPlugin;

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

defined( 'ABSPATH' ) or exit;

Expand Down Expand Up @@ -45,26 +45,26 @@ public function __construct() {
}


public function get_documentation_url() {

public function get_documentation_url() : ?string
{
return 'https://example.com';
}


public function get_settings_url( $plugin_id = null ) {

public function get_settings_url( string $plugin_id = null ) : string
{
return admin_url( 'admin.php?page=wc-settings' );
}


public function get_plugin_name() {

public function get_plugin_name() : string
{
return 'Plugin Framework Test';
}


protected function get_file() {

protected function get_file() : string
{
return __DIR__;
}

Expand Down
10 changes: 5 additions & 5 deletions tests/integration/API/CacheableAPIBaseTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\API\Abstract_Cacheable_API_Base;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\API\Traits\Cacheable_Request_Trait;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_API_JSON_Request;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_API_Request;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\API\Abstract_Cacheable_API_Base;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\API\Traits\Cacheable_Request_Trait;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_API_JSON_Request;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_API_Request;

if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', true );
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/DependenciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Tests for the SV_WC_Plugin_Dependencies class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Dependencies
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Dependencies
*/
class DependenciesTest extends \Codeception\TestCase\WPTestCase {

Expand Down Expand Up @@ -31,7 +31,7 @@ protected function _after() {


/**
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Dependencies::get_active_scripts_optimization_plugins()
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Dependencies::get_active_scripts_optimization_plugins()
*/
public function test_get_active_scripts_optimization_plugins() {

Expand All @@ -40,7 +40,7 @@ public function test_get_active_scripts_optimization_plugins() {


/**
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Dependencies::is_scripts_optimization_plugin_active()
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Dependencies::is_scripts_optimization_plugin_active()
*/
public function test_is_scripts_optimization_plugin_active() {

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/HelperTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;

/**
* Tests for the helper class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Compatibility
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Compatibility
*/
class HelperTest extends \Codeception\TestCase\WPTestCase {

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Tests for the base plugin class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin
*/
class PluginTest extends \Codeception\TestCase\WPTestCase {

Expand Down Expand Up @@ -152,7 +152,7 @@ public function test_get_framework_assets_path() {
*/
public function test_get_dependency_handler() {

$this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Dependencies', $this->get_plugin()->get_dependency_handler() );
$this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Dependencies', $this->get_plugin()->get_dependency_handler() );
}


Expand All @@ -161,7 +161,7 @@ public function test_get_dependency_handler() {
*/
public function test_get_lifecycle_handler() {

$this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_3\Plugin\Lifecycle', $this->get_plugin()->get_lifecycle_handler() );
$this->assertInstanceOf( '\SkyVerge\WooCommerce\PluginFramework\v5_15_4\Plugin\Lifecycle', $this->get_plugin()->get_lifecycle_handler() );
}


Expand Down
10 changes: 5 additions & 5 deletions tests/integration/REST_API/Controllers/SettingsTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3\REST_API\Controllers\Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Abstract_Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Setting;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Control;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\REST_API\Controllers\Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Abstract_Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Setting;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Control;

/**
* Tests for the Settings class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\REST_API\Controllers\Settings
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\REST_API\Controllers\Settings
*/
class SettingsTest extends \Codeception\TestCase\WPTestCase {

Expand Down
8 changes: 4 additions & 4 deletions tests/integration/REST_API/RESTAPITest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Abstract_Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Helper;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Abstract_Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Helper;

/**
* Tests for the REST_API class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\REST_API
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\REST_API
*/
class RESTAPITest extends \Codeception\TestCase\WPTestCase {

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/SV_WC_Payment_Gateway_Helper_Test.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Payment_Gateway_Helper;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Payment_Gateway_Helper;

/**
* Tests for the Payment Gateway Helper class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Payment_Gateway_Helper
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Payment_Gateway_Helper
*/
class SV_WC_Payment_Gateway_Helper_Test extends \Codeception\TestCase\WPTestCase {

Expand Down
12 changes: 6 additions & 6 deletions tests/integration/Settings_API/AbstractSettingsTest.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Abstract_Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Setting;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Control;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Exception;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4 as Framework;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Abstract_Settings;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Setting;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Control;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Exception;

/**
* Tests for the Abstract_Settings class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Abstract_Settings
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Abstract_Settings
*/
class AbstractSettingsTest extends \Codeception\TestCase\WPTestCase {

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Settings_API/SettingTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3\Settings_API\Setting;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Plugin_Exception;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\Settings_API\Setting;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Plugin_Exception;

class SettingTest extends \Codeception\TestCase\WPTestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/payment-gateway/GatewayPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Tests for the gateway plugin class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Payment_Gateway_Plugin
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Payment_Gateway_Plugin
*/
class GatewayPluginTest extends \Codeception\TestCase\WPTestCase {

Expand Down
8 changes: 4 additions & 4 deletions tests/integration/payment-gateway/MyPaymentMethodsTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Payment_Gateway_My_Payment_Methods;
use SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Payment_Gateway_Plugin;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Payment_Gateway_My_Payment_Methods;
use SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Payment_Gateway_Plugin;

/**
* Tests for the SV_WC_Payment_Gateway_My_Payment_Methods class.
*
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_3\SV_WC_Payment_Gateway_My_Payment_Methods
* @see \SkyVerge\WooCommerce\PluginFramework\v5_15_4\SV_WC_Payment_Gateway_My_Payment_Methods
*/
class MyPaymentMethodsTest extends \Codeception\TestCase\WPTestCase {

Expand Down Expand Up @@ -116,7 +116,7 @@ public function test_render_js() {
$payment_methods->render_js();

$this->assertStringContainsString( 'function load_gateway_test_plugin_payment_methods_handler', $wc_queued_js );
$this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_payment_methods_handler_v5_15_3_loaded\', load_gateway_test_plugin_payment_methods_handler );', $wc_queued_js );
$this->assertStringContainsString( 'window.jQuery( document.body ).on( \'sv_wc_payment_methods_handler_v5_15_4_loaded\', load_gateway_test_plugin_payment_methods_handler );', $wc_queued_js );
}


Expand Down
Loading
Loading