Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (4 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/oembed/discovery.php

    r36307 r42343  
    2020    function test_add_oembed_discovery_links_static_front_page() {
    2121        update_option( 'show_on_front', 'page' );
    22         update_option( 'page_on_front', self::factory()->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) );
     22        update_option(
     23            'page_on_front', self::factory()->post->create(
     24                array(
     25                    'post_title' => 'front-page',
     26                    'post_type'  => 'page',
     27                )
     28            )
     29        );
    2330
    2431        $this->go_to( home_url() );
    2532        $this->assertQueryTrue( 'is_front_page', 'is_singular', 'is_page' );
    2633
    27         $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
     34        $expected  = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
    2835        $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
    2936
     
    3845        $this->assertQueryTrue( 'is_single', 'is_singular' );
    3946
    40         $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
     47        $expected  = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
    4148        $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
    4249
     
    4552
    4653    function test_add_oembed_discovery_links_to_page() {
    47         $post_id = self::factory()->post->create( array(
    48             'post_type' => 'page'
    49         ));
     54        $post_id = self::factory()->post->create(
     55            array(
     56                'post_type' => 'page',
     57            )
     58        );
    5059        $this->go_to( get_permalink( $post_id ) );
    5160        $this->assertQueryTrue( 'is_page', 'is_singular' );
    5261
    53         $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
     62        $expected  = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
    5463        $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
    5564
     
    6069        $post_id       = self::factory()->post->create();
    6170        $file          = DIR_TESTDATA . '/images/canola.jpg';
    62         $attachment_id = self::factory()->attachment->create_object( $file, $post_id, array(
    63             'post_mime_type' => 'image/jpeg',
    64         ) );
     71        $attachment_id = self::factory()->attachment->create_object(
     72            $file, $post_id, array(
     73                'post_mime_type' => 'image/jpeg',
     74            )
     75        );
    6576
    6677        $this->go_to( get_permalink( $attachment_id ) );
    6778        $this->assertQueryTrue( 'is_attachment', 'is_singular', 'is_single' );
    6879
    69         $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
     80        $expected  = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
    7081        $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
    7182
Note: See TracChangeset for help on using the changeset viewer.