Ensure the $path is trailing-slashed in domain_exists().

Adds tests for [27717].

props ejdanderson, ericmann.
fixes #20589.


git-svn-id: https://develop.svn.wordpress.org/trunk@27718 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-03-25 17:39:08 +00:00
parent 89d81da181
commit 07eb830a9b

View File

@ -976,7 +976,7 @@ class Tests_MS extends WP_UnitTestCase {
}
function _domain_exists_cb( $exists, $domain, $path, $site_id ) {
if ( 'foo' == $domain && 'bar' == $path )
if ( 'foo' == $domain && 'bar/' == $path )
return 1234;
else
return null;
@ -998,6 +998,9 @@ class Tests_MS extends WP_UnitTestCase {
$this->assertEquals( null, domain_exists( 'foo', 'baz' ) );
$this->assertEquals( null, domain_exists( 'bar', 'foo' ) );
// Make sure the same result is returned with or without a trailing slash
$this->assertEquals( domain_exists( 'foo', 'bar' ), domain_exists( 'foo', 'bar/' ) );
remove_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
$this->assertEquals( null, domain_exists( 'foo', 'bar' ) );