From c7c227be6f3e61dda3b09b843ce2fc6e4dbff66f Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Thu, 8 Mar 2018 12:34:21 -0500 Subject: [PATCH] remove AMP_WP_Utils class and tests --- includes/class-amp-autoloader.php | 1 - includes/utils/class-amp-wp-utils.php | 61 --------------------------- tests/test-amp-wp-utils.php | 47 --------------------- 3 files changed, 109 deletions(-) delete mode 100644 includes/utils/class-amp-wp-utils.php delete mode 100644 tests/test-amp-wp-utils.php diff --git a/includes/class-amp-autoloader.php b/includes/class-amp-autoloader.php index 3ec923b7bde..0533b2dd96b 100644 --- a/includes/class-amp-autoloader.php +++ b/includes/class-amp-autoloader.php @@ -86,7 +86,6 @@ class AMP_Autoloader { 'AMP_Image_Dimension_Extractor' => 'includes/utils/class-amp-image-dimension-extractor', 'AMP_Validation_Utils' => 'includes/utils/class-amp-validation-utils', 'AMP_String_Utils' => 'includes/utils/class-amp-string-utils', - 'AMP_WP_Utils' => 'includes/utils/class-amp-wp-utils', 'AMP_Widget_Archives' => 'includes/widgets/class-amp-widget-archives', 'AMP_Widget_Categories' => 'includes/widgets/class-amp-widget-categories', 'AMP_Widget_Media_Video' => 'includes/widgets/class-amp-widget-media-video', diff --git a/includes/utils/class-amp-wp-utils.php b/includes/utils/class-amp-wp-utils.php deleted file mode 100644 index bacb72458af..00000000000 --- a/includes/utils/class-amp-wp-utils.php +++ /dev/null @@ -1,61 +0,0 @@ - 'scheme', - PHP_URL_HOST => 'host', - PHP_URL_PORT => 'port', - PHP_URL_USER => 'user', - PHP_URL_PASS => 'pass', - PHP_URL_PATH => 'path', - PHP_URL_QUERY => 'query', - PHP_URL_FRAGMENT => 'fragment', - ); - - if ( isset( $translation[ $constant ] ) ) { - return $translation[ $constant ]; - } - - return false; - } -} diff --git a/tests/test-amp-wp-utils.php b/tests/test-amp-wp-utils.php deleted file mode 100644 index 43f3b3a572e..00000000000 --- a/tests/test-amp-wp-utils.php +++ /dev/null @@ -1,47 +0,0 @@ - array( - 'https://example.com/path', - array( - 'scheme' => 'https', - 'host' => 'example.com', - 'path' => '/path', - ), - -1, - ), - - 'valid__with_component' => array( - 'https://example.com/path', - 'example.com', - PHP_URL_HOST, - ), - - 'valid__schemaless__no_component' => array( - '//example.com/path', - array( - 'host' => 'example.com', - 'path' => '/path', - ), - -1, - ), - - 'valid__schemaless__with_component' => array( - '//example.com/path', - 'example.com', - PHP_URL_HOST, - ), - ); - } - - /** - * @dataProvider get_test_data - */ - function test__method( $url, $expected, $component ) { - $actual = AMP_WP_Utils::parse_url( $url, $component ); - - $this->assertEquals( $expected, $actual ); - } -}