Changeset 28280 for trunk/tests/phpunit/tests/ms.php
- Timestamp:
- 05/06/2014 05:31:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/ms.php
r27718 r28280 1226 1226 /** 1227 1227 * @ticket 27003 1228 * @ticket 27927 1228 1229 */ 1229 1230 function test_get_site_by_path() { … … 1234 1235 'make.wordpress.org/' => array( 'domain' => 'make.wordpress.org', 'path' => '/' ), 1235 1236 'make.wordpress.org/foo/' => array( 'domain' => 'make.wordpress.org', 'path' => '/foo/' ), 1237 'www.w.org/' => array( 'domain' => 'www.w.org', 'path' => '/' ), 1238 'www.w.org/foo/' => array( 'domain' => 'www.w.org', 'path' => '/foo/' ), 1239 'www.w.org/foo/bar/' => array( 'domain' => 'www.w.org', 'path' => '/foo/bar/' ), 1236 1240 ); 1237 1241 … … 1244 1248 get_site_by_path( 'wordpress.org', '/notapath/' )->blog_id ); 1245 1249 1250 $this->assertEquals( $ids['wordpress.org/'], 1251 get_site_by_path( 'www.wordpress.org', '/notapath/' )->blog_id ); 1252 1246 1253 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1247 1254 get_site_by_path( 'wordpress.org', '/foo/bar/baz/' )->blog_id ); 1248 1255 1249 1256 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1257 get_site_by_path( 'www.wordpress.org', '/foo/bar/baz/' )->blog_id ); 1258 1259 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1250 1260 get_site_by_path( 'wordpress.org', '/foo/bar/baz/', 3 )->blog_id ); 1261 1262 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1263 get_site_by_path( 'www.wordpress.org', '/foo/bar/baz/', 3 )->blog_id ); 1251 1264 1252 1265 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1253 1266 get_site_by_path( 'wordpress.org', '/foo/bar/baz/', 2 )->blog_id ); 1254 1267 1268 $this->assertEquals( $ids['wordpress.org/foo/bar/'], 1269 get_site_by_path( 'www.wordpress.org', '/foo/bar/baz/', 2 )->blog_id ); 1270 1255 1271 $this->assertEquals( $ids['wordpress.org/foo/'], 1256 1272 get_site_by_path( 'wordpress.org', '/foo/bar/baz/', 1 )->blog_id ); 1257 1273 1274 $this->assertEquals( $ids['wordpress.org/foo/'], 1275 get_site_by_path( 'www.wordpress.org', '/foo/bar/baz/', 1 )->blog_id ); 1276 1258 1277 $this->assertEquals( $ids['wordpress.org/'], 1259 1278 get_site_by_path( 'wordpress.org', '/', 0 )->blog_id ); 1260 1279 1280 $this->assertEquals( $ids['wordpress.org/'], 1281 get_site_by_path( 'www.wordpress.org', '/', 0 )->blog_id ); 1282 1261 1283 $this->assertEquals( $ids['make.wordpress.org/foo/'], 1262 1284 get_site_by_path( 'make.wordpress.org', '/foo/bar/baz/qux/', 4 )->blog_id ); 1285 1286 $this->assertEquals( $ids['make.wordpress.org/foo/'], 1287 get_site_by_path( 'www.make.wordpress.org', '/foo/bar/baz/qux/', 4 )->blog_id ); 1288 1289 $this->assertEquals( $ids['www.w.org/'], 1290 get_site_by_path( 'www.w.org', '/', 0 )->blog_id ); 1291 1292 $this->assertEquals( $ids['www.w.org/'], 1293 get_site_by_path( 'www.w.org', '/notapath/' )->blog_id ); 1294 1295 $this->assertEquals( $ids['www.w.org/foo/bar/'], 1296 get_site_by_path( 'www.w.org', '/foo/bar/baz/' )->blog_id ); 1297 1298 $this->assertEquals( $ids['www.w.org/foo/'], 1299 get_site_by_path( 'www.w.org', '/foo/bar/baz/', 1 )->blog_id ); 1300 1301 // A site installed with www will not be found by the root domain. 1302 $this->assertFalse( get_site_by_path( 'w.org', '/' ) ); 1303 $this->assertFalse( get_site_by_path( 'w.org', '/notapath/' ) ); 1304 $this->assertFalse( get_site_by_path( 'w.org', '/foo/bar/baz/' ) ); 1305 $this->assertFalse( get_site_by_path( 'w.org', '/foo/bar/baz/', 1 ) ); 1306 1307 // A site will not be found by its root domain when an invalid subdomain is requested. 1308 $this->assertFalse( get_site_by_path( 'invalid.wordpress.org', '/' ) ); 1309 $this->assertFalse( get_site_by_path( 'invalid.wordpress.org', '/foo/bar/' ) ); 1263 1310 } 1264 1311
Note: See TracChangeset
for help on using the changeset viewer.