Skip to content

Commit

Permalink
Fix ValidVariableName.NotSnakeCaseMemberVar, CommentedOutCode.Found, …
Browse files Browse the repository at this point in the history
…OneClassPerFile.MultipleFound
  • Loading branch information
westonruter committed Mar 17, 2018
1 parent 8703c29 commit ac33200
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
4 changes: 2 additions & 2 deletions includes/embeds/class-amp-youtube-embed.php
Expand Up @@ -158,7 +158,7 @@ private function get_video_id_from_url( $url ) {
$video_id = $parts[1];
}
} else {
/* ?v={id} or ?list={id} */
/* The query looks like ?v={id} or ?list={id} */
parse_str( $parsed_url['query'], $query_args );

if ( isset( $query_args['v'] ) ) {
Expand All @@ -167,7 +167,7 @@ private function get_video_id_from_url( $url ) {
}

if ( empty( $video_id ) ) {
/* /(v|e|embed)/{id} */
/* The path looks like /(v|e|embed)/{id} */
$parts = explode( '/', $parsed_url['path'] );

if ( in_array( $parts[1], array( 'v', 'e', 'embed' ), true ) ) {
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Expand Up @@ -28,7 +28,7 @@
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName">
<properties>
<property name="customPropertiesWhitelist" value="childNodes,tagName,textContent,parentNode,nodeType,nodeName,nextSibling,firstChild,nodeValue,DEFAULT_ARGS,documentElement,removeChild,ownerDocument" />
<property name="customPropertiesWhitelist" value="childNodes,tagName,textContent,parentNode,nodeType,nodeName,nextSibling,firstChild,nodeValue,DEFAULT_ARGS,documentElement,removeChild,ownerDocument,DEFAULT_WIDTH,DEFAULT_HEIGHT" />
</properties>
</rule>

Expand Down
21 changes: 3 additions & 18 deletions tests/test-amp-image-dimension-extractor.php
Expand Up @@ -56,14 +56,7 @@ public function test__should_return_original_urls() {

$this->assertEquals( $expected, $actual );
}
}

/**
* Tests for AMP_Image_Dimension_Extractor_Normalize_URL.
*
* @covers AMP_Image_Dimension_Extractor_Normalize_URL
*/
class AMP_Image_Dimension_Extractor_Normalize_URL_Test extends WP_UnitTestCase {
/**
* Data strings for testing converter.
*
Expand Down Expand Up @@ -117,20 +110,12 @@ public function test__normalize_url( $source_url, $expected_url ) {

$this->assertEquals( $expected_url, $result_url );
}
}

/**
* Tests for AMP_Image_Dimension_Extractor_By_Downloading.
*
* @covers AMP_Image_Dimension_Extractor_By_Downloading
*
* TODO: tests for transients, errors, lock
* TODO: mocked tests
*/
class AMP_Image_Dimension_Extractor_By_Downloading_Test extends WP_UnitTestCase {

/**
* Test a valid image file.
*
* TODO: tests for transients, errors, lock
* TODO: mocked tests
*/
public function test__valid_image_file() {
$sources = array(
Expand Down

0 comments on commit ac33200

Please sign in to comment.