| @@ 1194-1210 (lines=17) @@ | ||
| 1191 | /** |
|
| 1192 | * @ticket 35902 |
|
| 1193 | */ |
|
| 1194 | public function test_is_attachment_should_not_match_numeric_id_to_post_title_beginning_with_id() |
|
| 1195 | { |
|
| 1196 | $p1 = self::factory()->post->create( |
|
| 1197 | array( |
|
| 1198 | 'post_type' => 'attachment', |
|
| 1199 | 'post_title' => 'Foo', |
|
| 1200 | 'post_name' => 'foo', |
|
| 1201 | ) |
|
| 1202 | ); |
|
| 1203 | $p2 = self::factory()->post->create( |
|
| 1204 | array( |
|
| 1205 | 'post_type' => 'attachment', |
|
| 1206 | 'post_title' => "$p1 Foo", |
|
| 1207 | 'post_name' => 'foo-2', |
|
| 1208 | ) |
|
| 1209 | ); |
|
| 1210 | ||
| 1211 | $this->go_to(get_permalink($p2)); |
|
| 1212 | ||
| 1213 | $this->assertTrue(is_attachment($p2)); |
|
| @@ 1220-1236 (lines=17) @@ | ||
| 1217 | /** |
|
| 1218 | * @ticket 35902 |
|
| 1219 | */ |
|
| 1220 | public function test_is_attachment_should_not_match_numeric_id_to_post_name_beginning_with_id() |
|
| 1221 | { |
|
| 1222 | $p1 = self::factory()->post->create( |
|
| 1223 | array( |
|
| 1224 | 'post_type' => 'attachment', |
|
| 1225 | 'post_title' => 'Foo', |
|
| 1226 | 'post_name' => 'foo', |
|
| 1227 | ) |
|
| 1228 | ); |
|
| 1229 | $p2 = self::factory()->post->create( |
|
| 1230 | array( |
|
| 1231 | 'post_type' => 'attachment', |
|
| 1232 | 'post_title' => 'Foo', |
|
| 1233 | 'post_name' => "$p1-foo", |
|
| 1234 | ) |
|
| 1235 | ); |
|
| 1236 | ||
| 1237 | $this->go_to(get_permalink($p2)); |
|
| 1238 | ||
| 1239 | $this->assertTrue(is_attachment($p2)); |
|
| @@ 1294-1310 (lines=17) @@ | ||
| 1291 | /** |
|
| 1292 | * @ticket 35902 |
|
| 1293 | */ |
|
| 1294 | public function test_is_category_should_not_match_numeric_id_to_name_beginning_with_id() |
|
| 1295 | { |
|
| 1296 | $t1 = self::factory()->term->create( |
|
| 1297 | array( |
|
| 1298 | 'taxonomy' => 'category', |
|
| 1299 | 'slug' => 'foo', |
|
| 1300 | 'name' => 'foo', |
|
| 1301 | ) |
|
| 1302 | ); |
|
| 1303 | $t2 = self::factory()->term->create( |
|
| 1304 | array( |
|
| 1305 | 'taxonomy' => 'category', |
|
| 1306 | 'slug' => "$t1-foo", |
|
| 1307 | 'name' => 'foo 2', |
|
| 1308 | ) |
|
| 1309 | ); |
|
| 1310 | ||
| 1311 | $this->go_to(get_term_link($t2)); |
|
| 1312 | ||
| 1313 | $this->assertTrue(is_category($t2)); |
|
| @@ 1320-1336 (lines=17) @@ | ||
| 1317 | /** |
|
| 1318 | * @ticket 35902 |
|
| 1319 | */ |
|
| 1320 | public function test_is_category_should_not_match_numeric_id_to_slug_beginning_with_id() |
|
| 1321 | { |
|
| 1322 | $t1 = self::factory()->term->create( |
|
| 1323 | array( |
|
| 1324 | 'taxonomy' => 'category', |
|
| 1325 | 'slug' => 'foo', |
|
| 1326 | 'name' => 'foo', |
|
| 1327 | ) |
|
| 1328 | ); |
|
| 1329 | $t2 = self::factory()->term->create( |
|
| 1330 | array( |
|
| 1331 | 'taxonomy' => 'category', |
|
| 1332 | 'slug' => 'foo-2', |
|
| 1333 | 'name' => "$t1 foo", |
|
| 1334 | ) |
|
| 1335 | ); |
|
| 1336 | ||
| 1337 | $this->go_to(get_term_link($t2)); |
|
| 1338 | ||
| 1339 | $this->assertTrue(is_category($t2)); |
|
| @@ 1346-1362 (lines=17) @@ | ||
| 1343 | /** |
|
| 1344 | * @ticket 35902 |
|
| 1345 | */ |
|
| 1346 | public function test_is_tag_should_not_match_numeric_id_to_name_beginning_with_id() |
|
| 1347 | { |
|
| 1348 | $t1 = self::factory()->term->create( |
|
| 1349 | array( |
|
| 1350 | 'taxonomy' => 'post_tag', |
|
| 1351 | 'slug' => 'foo', |
|
| 1352 | 'name' => 'foo', |
|
| 1353 | ) |
|
| 1354 | ); |
|
| 1355 | $t2 = self::factory()->term->create( |
|
| 1356 | array( |
|
| 1357 | 'taxonomy' => 'post_tag', |
|
| 1358 | 'slug' => "$t1-foo", |
|
| 1359 | 'name' => 'foo 2', |
|
| 1360 | ) |
|
| 1361 | ); |
|
| 1362 | ||
| 1363 | $this->go_to(get_term_link($t2)); |
|
| 1364 | ||
| 1365 | $this->assertTrue(is_tag($t2)); |
|
| @@ 1372-1388 (lines=17) @@ | ||
| 1369 | /** |
|
| 1370 | * @ticket 35902 |
|
| 1371 | */ |
|
| 1372 | public function test_is_tag_should_not_match_numeric_id_to_slug_beginning_with_id() |
|
| 1373 | { |
|
| 1374 | $t1 = self::factory()->term->create( |
|
| 1375 | array( |
|
| 1376 | 'taxonomy' => 'post_tag', |
|
| 1377 | 'slug' => 'foo', |
|
| 1378 | 'name' => 'foo', |
|
| 1379 | ) |
|
| 1380 | ); |
|
| 1381 | $t2 = self::factory()->term->create( |
|
| 1382 | array( |
|
| 1383 | 'taxonomy' => 'post_tag', |
|
| 1384 | 'slug' => 'foo-2', |
|
| 1385 | 'name' => "$t1 foo", |
|
| 1386 | ) |
|
| 1387 | ); |
|
| 1388 | ||
| 1389 | $this->go_to(get_term_link($t2)); |
|
| 1390 | ||
| 1391 | $this->assertTrue(is_tag($t2)); |
|
| @@ 1398-1414 (lines=17) @@ | ||
| 1395 | /** |
|
| 1396 | * @ticket 35902 |
|
| 1397 | */ |
|
| 1398 | public function test_is_page_should_not_match_numeric_id_to_post_title_beginning_with_id() |
|
| 1399 | { |
|
| 1400 | $p1 = self::factory()->post->create( |
|
| 1401 | array( |
|
| 1402 | 'post_type' => 'page', |
|
| 1403 | 'post_title' => 'Foo', |
|
| 1404 | 'post_name' => 'foo', |
|
| 1405 | ) |
|
| 1406 | ); |
|
| 1407 | $p2 = self::factory()->post->create( |
|
| 1408 | array( |
|
| 1409 | 'post_type' => 'page', |
|
| 1410 | 'post_title' => "$p1 Foo", |
|
| 1411 | 'post_name' => 'foo-2', |
|
| 1412 | ) |
|
| 1413 | ); |
|
| 1414 | ||
| 1415 | $this->go_to(get_permalink($p2)); |
|
| 1416 | ||
| 1417 | $this->assertTrue(is_page($p2)); |
|
| @@ 1424-1440 (lines=17) @@ | ||
| 1421 | /** |
|
| 1422 | * @ticket 35902 |
|
| 1423 | */ |
|
| 1424 | public function test_is_page_should_not_match_numeric_id_to_post_name_beginning_with_id() |
|
| 1425 | { |
|
| 1426 | $p1 = self::factory()->post->create( |
|
| 1427 | array( |
|
| 1428 | 'post_type' => 'page', |
|
| 1429 | 'post_title' => 'Foo', |
|
| 1430 | 'post_name' => 'foo', |
|
| 1431 | ) |
|
| 1432 | ); |
|
| 1433 | $p2 = self::factory()->post->create( |
|
| 1434 | array( |
|
| 1435 | 'post_type' => 'page', |
|
| 1436 | 'post_title' => 'Foo', |
|
| 1437 | 'post_name' => "$p1-foo", |
|
| 1438 | ) |
|
| 1439 | ); |
|
| 1440 | ||
| 1441 | $this->go_to(get_permalink($p2)); |
|
| 1442 | ||
| 1443 | $this->assertTrue(is_page($p2)); |
|
| @@ 1450-1466 (lines=17) @@ | ||
| 1447 | /** |
|
| 1448 | * @ticket 35902 |
|
| 1449 | */ |
|
| 1450 | public function test_is_single_should_not_match_numeric_id_to_post_title_beginning_with_id() |
|
| 1451 | { |
|
| 1452 | $p1 = self::factory()->post->create( |
|
| 1453 | array( |
|
| 1454 | 'post_type' => 'post', |
|
| 1455 | 'post_title' => 'Foo', |
|
| 1456 | 'post_name' => 'foo', |
|
| 1457 | ) |
|
| 1458 | ); |
|
| 1459 | $p2 = self::factory()->post->create( |
|
| 1460 | array( |
|
| 1461 | 'post_type' => 'post', |
|
| 1462 | 'post_title' => "$p1 Foo", |
|
| 1463 | 'post_name' => 'foo-2', |
|
| 1464 | ) |
|
| 1465 | ); |
|
| 1466 | ||
| 1467 | $this->go_to(get_permalink($p2)); |
|
| 1468 | ||
| 1469 | $this->assertTrue(is_single($p2)); |
|
| @@ 1476-1492 (lines=17) @@ | ||
| 1473 | /** |
|
| 1474 | * @ticket 35902 |
|
| 1475 | */ |
|
| 1476 | public function test_is_single_should_not_match_numeric_id_to_post_name_beginning_with_id() |
|
| 1477 | { |
|
| 1478 | $p1 = self::factory()->post->create( |
|
| 1479 | array( |
|
| 1480 | 'post_type' => 'post', |
|
| 1481 | 'post_title' => 'Foo', |
|
| 1482 | 'post_name' => 'foo', |
|
| 1483 | ) |
|
| 1484 | ); |
|
| 1485 | $p2 = self::factory()->post->create( |
|
| 1486 | array( |
|
| 1487 | 'post_type' => 'post', |
|
| 1488 | 'post_title' => 'Foo', |
|
| 1489 | 'post_name' => "$p1-foo", |
|
| 1490 | ) |
|
| 1491 | ); |
|
| 1492 | ||
| 1493 | $this->go_to(get_permalink($p2)); |
|
| 1494 | ||
| 1495 | $this->assertTrue(is_single($p2)); |
|