Make WordPress Core

Ticket #33620: 33620.test.diff

File 33620.test.diff, 1.1 KB (added by tryon, 9 years ago)

A unit test for 33620.diff

  • tests/phpunit/tests/multisite/site.php

     
    11841184                $blogaddress = get_blogaddress_by_id( 42 );
    11851185                $this->assertEquals( '', $blogaddress );
    11861186        }
     1187
     1188        /**
     1189         * @ticket 33620, test to make sure a site will be created as https if its a subdomain install and the sireurl is https
     1190         */
     1191        function test_create_https_blog(){
     1192                // test only works on subdomain installs
     1193                $this->assertEquals( SUBDOMAIN_INSTALL, false );
     1194
     1195                //get the current siteurl
     1196                $existing_siteurl = get_site_option( 'siteurl' );
     1197
     1198                // set the site url to https
     1199                update_site_option( 'siteurl', str_replace( "http://", "https://", $existing_siteurl ) );
     1200
     1201                //make a new blog
     1202                $blog_id = $this->factory->blog->create();
     1203
     1204                //get the new blogs details
     1205                $details = get_blog_details( $blog_id );
     1206
     1207                //test if the blog home is https
     1208                $this->assertContains( 'https', $details->siteurl );
     1209        }
    11871210}
    11881211
    11891212endif;