From 0e73cc3da4e59f4371e49189180ff054d9a5806b Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 9 Jan 2016 08:08:47 +0000 Subject: [PATCH] Tests: Add more paged canonical tests for page_on_front. See #35344. git-svn-id: https://develop.svn.wordpress.org/trunk@36238 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/canonical/pageOnFront.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/canonical/pageOnFront.php b/tests/phpunit/tests/canonical/pageOnFront.php index 030befa573..3b04ca8f22 100644 --- a/tests/phpunit/tests/canonical/pageOnFront.php +++ b/tests/phpunit/tests/canonical/pageOnFront.php @@ -19,7 +19,7 @@ class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase { update_option( 'show_on_front', 'page' ); update_option( 'page_for_posts', self::factory()->post->create( array( 'post_title' => 'blog-page', 'post_type' => 'page' ) ) ); - update_option( 'page_on_front', self::factory()->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) ); + update_option( 'page_on_front', self::factory()->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page', 'post_content' => "Page 1\n\nPage 2" ) ) ); } /** @@ -39,11 +39,17 @@ class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase { * [3]: (optional) The ticket the test refers to, Can be skipped if unknown. */ return array( - // Check against an odd redirect - array( '/page/2/', '/page/2/', 20385 ), - // The page designated as the front page should redirect to the front of the site - array( '/front-page/', '/' ), - array( '/blog-page/?paged=2', '/blog-page/page/2/' ), + // Check against an odd redirect + array( '/page/2/', '/page/2/' ), + array( '/?page=2', '/page/2/' ), + array( '/page/1/', '/' ), + array( '/?page=1', '/' ), + + // The page designated as the front page should redirect to the front of the site + array( '/front-page/', '/' ), + array( '/front-page/2/', '/page/2/' ), + array( '/front-page/?page=2', '/page/2/' ), + array( '/blog-page/?paged=2', '/blog-page/page/2/' ), ); } }