From ae12409454f1cab96c495a62363a210fc0c8807d Mon Sep 17 00:00:00 2001 From: David Remer Date: Wed, 2 Sep 2020 07:51:07 +0300 Subject: [PATCH] update unit tests for new autoloader, remove inc/autoload.php --- inc/autoload.php | 67 ------------------------------------- tests/PHPUnit/bootstrap.php | 2 -- 2 files changed, 69 deletions(-) delete mode 100644 inc/autoload.php diff --git a/inc/autoload.php b/inc/autoload.php deleted file mode 100644 index d0332042b..000000000 --- a/inc/autoload.php +++ /dev/null @@ -1,67 +0,0 @@ - $module_dir . 'ppcp-admin-notices/src/', - 'ApiClient' => $module_dir . 'ppcp-api-client/src/', - 'Button' => $module_dir . 'ppcp-button/src/', - 'Logging' => $module_dir . 'woocommerce-logging/src/', - 'Onboarding' => $module_dir . 'ppcp-onboarding/src/', - 'Session' => $module_dir . 'ppcp-session/src/', - 'Subscription' => $module_dir . 'ppcp-subscription/src/', - 'WcGateway' => $module_dir . 'ppcp-wc-gateway/src/', - 'Webhooks' => $module_dir . 'ppcp-webhooks/src/', - ); - - if ( isset( $class_parts[2] ) && ! isset( $class_parts[3] ) ) { - $file_path = dirname( __DIR__ ) . '/src/class-' . strtolower( $class_parts[2] ) . '.php'; - include $file_path; - return; - } - - if ( ! isset( $modules[ $class_parts[2] ] ) ) { - return; - } - - $file_path = $modules[ $class_parts[2] ]; - unset( $class_parts[0] ); - unset( $class_parts[1] ); - unset( $class_parts[2] ); - $file_name = 'class-' . strtolower( end( $class_parts ) ) . '.php'; - array_pop( $class_parts ); - - $file_path .= implode( DIRECTORY_SEPARATOR, $class_parts ) . '/' . $file_name; - include $file_path; - } - ); - - // Load composer autoloader. - include dirname( __DIR__ ) . '/vendor/autoload.php'; - -} diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php index 2f4ce49c6..b5e94de56 100644 --- a/tests/PHPUnit/bootstrap.php +++ b/tests/PHPUnit/bootstrap.php @@ -1,7 +1,5 @@