Skip to content

Commit

Permalink
tests: declare visiblity for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Schreiber authored and paulschreiber committed Mar 10, 2018
1 parent e04ce22 commit 78e64f4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions tests/test-amp-analytics-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ private function insert_one_option( $type, $config ) {
/**
* Test that nothing is added if no analytics option defined in the DB
*/
function test_no_options() {
public function test_no_options() {
$options = $this->get_options();
$this->assertEmpty( $options );
}

/**
* Test that exactly one analytics component is inserted into the DB
*/
function test_one_option_inserted() {
public function test_one_option_inserted() {
$this->insert_one_option(
$this->vendor,
$this->config_one
Expand All @@ -103,7 +103,7 @@ function test_one_option_inserted() {
/**
* Test that two analytics components are inserted into the DB
*/
function test_two_options_inserted() {
public function test_two_options_inserted() {

/* Insert analytics option one */
$this->insert_one_option(
Expand All @@ -124,7 +124,7 @@ function test_two_options_inserted() {
/**
* Test that the analytics JS is added to the page
*/
function test_analytics_js_added() {
public function test_analytics_js_added() {

/* Insert analytics option */
$this->insert_one_option(
Expand Down Expand Up @@ -158,7 +158,7 @@ function test_analytics_js_added() {
/**
* Test that exactly one analytics component are added to the page
*/
function test_one_analytics_component_added() {
public function test_one_analytics_component_added() {

/* Insert analytics option */
$this->insert_one_option(
Expand Down Expand Up @@ -186,7 +186,7 @@ function test_one_analytics_component_added() {
/**
* Test that two analytics components are added to the page
*/
function test_two_analytics_components_added() {
public function test_two_analytics_components_added() {

$this->insert_one_option(
$this->vendor,
Expand Down
22 changes: 11 additions & 11 deletions tests/test-amp-image-dimension-extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function test__should_return_original_urls() {
}

class AMP_Image_Dimension_Extractor__Normalize_URL__Test extends WP_UnitTestCase {
function get_data() {
public function get_data() {
$site_url = site_url();

return array(
Expand Down Expand Up @@ -79,7 +79,7 @@ function get_data() {
/**
* @dataProvider get_data
*/
function test__normalize_url( $source_url, $expected_url ) {
public function test__normalize_url( $source_url, $expected_url ) {
$result_url = AMP_Image_Dimension_Extractor::normalize_url( $source_url );

$this->assertEquals( $expected_url, $result_url );
Expand All @@ -90,7 +90,7 @@ function test__normalize_url( $source_url, $expected_url ) {
// TODO: mocked tests
class AMP_Image_Dimension_Extractor__By_Downloading__Test extends WP_UnitTestCase {

function test__valid_image_file() {
public function test__valid_image_file() {
$sources = array(
IMG_350 => false,
);
Expand All @@ -106,7 +106,7 @@ function test__valid_image_file() {
$this->assertEquals( $expected, $dimensions );
}

function test__valid_image_file_synchronous() {
public function test__valid_image_file_synchronous() {
$sources = array(
IMG_350 => false,
);
Expand All @@ -122,7 +122,7 @@ function test__valid_image_file_synchronous() {
$this->assertEquals( $expected, $dimensions );
}

function test__multiple_valid_image_files() {
public function test__multiple_valid_image_files() {
$sources = array(
IMG_350 => false,
IMG_1024 => false,
Expand All @@ -143,7 +143,7 @@ function test__multiple_valid_image_files() {
$this->assertEquals( $expected, $dimensions );
}

function test__multiple_valid_image_files_synchronous() {
public function test__multiple_valid_image_files_synchronous() {
$sources = array(
IMG_350 => false,
IMG_1024 => false,
Expand All @@ -164,7 +164,7 @@ function test__multiple_valid_image_files_synchronous() {
$this->assertEquals( $expected, $dimensions );
}

function test__invalid_image_file() {
public function test__invalid_image_file() {
$sources = array(
AMP_IMG_DIMENSION_TEST_INVALID_FILE => false,
);
Expand All @@ -177,7 +177,7 @@ function test__invalid_image_file() {
$this->assertEquals( $expected, $dimensions );
}

function test__invalid_image_file_synchronous() {
public function test__invalid_image_file_synchronous() {
$sources = array(
AMP_IMG_DIMENSION_TEST_INVALID_FILE => false,
);
Expand All @@ -190,7 +190,7 @@ function test__invalid_image_file_synchronous() {
$this->assertEquals( $expected, $dimensions );
}

function test__mix_of_valid_and_invalid_image_file() {
public function test__mix_of_valid_and_invalid_image_file() {
$sources = array(
IMG_350 => false,
AMP_IMG_DIMENSION_TEST_INVALID_FILE => false,
Expand All @@ -213,7 +213,7 @@ function test__mix_of_valid_and_invalid_image_file() {
$this->assertEquals( $expected, $dimensions );
}

function test__mix_of_valid_and_invalid_image_file_synchronous() {
public function test__mix_of_valid_and_invalid_image_file_synchronous() {
$sources = array(
IMG_350 => false,
AMP_IMG_DIMENSION_TEST_INVALID_FILE => false,
Expand All @@ -236,7 +236,7 @@ function test__mix_of_valid_and_invalid_image_file_synchronous() {
$this->assertEquals( $expected, $dimensions );
}

function test__amp_wp_user_agent() {
public function test__amp_wp_user_agent() {
$expected = 'amp-wp, v' . AMP__VERSION . ', ';
$user_agent = AMP_Image_Dimension_Extractor::get_default_user_agent( '' );
$user_agent = substr( $user_agent, 0, strlen( $expected ) );
Expand Down
4 changes: 2 additions & 2 deletions tests/test-amp-wp-utils.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

class AMP_WP_Utils__Parse_Url__Test extends WP_UnitTestCase {
function get_test_data() {
public function get_test_data() {
return array(
'valid__no_component' => array(
'https://example.com/path',
Expand Down Expand Up @@ -39,7 +39,7 @@ function get_test_data() {
/**
* @dataProvider get_test_data
*/
function test__method( $url, $expected, $component ) {
public function test__method( $url, $expected, $component ) {
$actual = AMP_WP_Utils::parse_url( $url, $component );

$this->assertEquals( $expected, $actual );
Expand Down

0 comments on commit 78e64f4

Please sign in to comment.