Changeset 27359 for trunk/tests/phpunit/tests/ms.php
- Timestamp:
- 03/02/2014 10:24:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ms.php
r27290 r27359 1222 1222 1223 1223 /** 1224 * @ticket 27003 1225 */ 1226 function test_get_site_by_path() { 1227 $ids = array( 1228 'wordpress.org/' => array( 'domain' => 'wordpress.org', 'path' => '/' ), 1229 'wordpress.org/foo/' => array( 'domain' => 'wordpress.org', 'path' => '/foo/' ), 1230 'wordpress.org/foo/bar/' => array( 'domain' => 'wordpress.org', 'path' => '/foo/bar/' ), 1231 'make.wordpress.org/' => array( 'domain' => 'make.wordpress.org', 'path' => '/' ), 1232 'make.wordpress.org/foo/' => array( 'domain' => 'make.wordpress.org', 'path' => '/foo/' ), 1233 ); 1234 1235 foreach ( $ids as &$id ) { 1236 $id = $this->factory->blog->create( $id ); 1237 } 1238 unset( $id ); 1239 1240 $this->assertEquals( $ids['wordpress.org/'], 1241 get_site_by_path( 'wordpress.org', '/notapath/' )->blog_id ); 1242 1243 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1244 get_site_by_path( 'wordpress.org', '/foo/bar/baz/' )->blog_id ); 1245 1246 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1247 get_site_by_path( 'wordpress.org', '/foo/bar/baz/', 3 )->blog_id ); 1248 1249 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1250 get_site_by_path( 'wordpress.org', '/foo/bar/baz/', 2 )->blog_id ); 1251 1252 $this->assertEquals( $ids['wordpress.org/foo/'], 1253 get_site_by_path( 'wordpress.org', '/foo/bar/baz/', 1 )->blog_id ); 1254 1255 $this->assertEquals( $ids['wordpress.org/'], 1256 get_site_by_path( 'wordpress.org', '/', 0 )->blog_id ); 1257 1258 $this->assertEquals( $ids['make.wordpress.org/foo/'], 1259 get_site_by_path( 'make.wordpress.org', '/foo/bar/baz/qux/', 4 )->blog_id ); 1260 } 1261 1262 /** 1224 1263 * @ticket 20601 1225 1264 */
Note: See TracChangeset
for help on using the changeset viewer.