Skip to content
Snippets Groups Projects

Add block-editor support

Merged Erick Hitter requested to merge fix/gutenberg into master
Compare and Show latest version
2 files
+ 100
9
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -111,9 +111,24 @@ class Test_Automatically_Paginate_Posts extends WP_UnitTestCase {
public function test_filter_the_posts( $expected, $input ) {
$post = $this->factory->post->create_and_get( $input['post_args'] );
update_option( 'autopaging_paging_type', $input['type'] );
update_option( 'autopaging_num_pages', $input['num_pages'] );
update_option( 'autopaging_num_words', $input['num_words'] );
add_filter(
'pre_option_pages',
static function() use( $input ) {
return $input['type'];
}
);
add_filter(
'autopaging_num_pages',
static function() use( $input ) {
return $input['num_pages'];
}
);
add_filter(
'autopaging_num_words',
static function() use( $input ) {
return $input['num_words'];
}
);
$this->assertEquals(
$expected,
@@ -152,7 +167,7 @@ class Test_Automatically_Paginate_Posts extends WP_UnitTestCase {
'num_words' => 2,
),
),
'Classic post, two pages' => array(
'Classic post, two pages, split to pages' => array(
"1\r\n\r\n2<!--nextpage-->\r\n\r\n3",
array(
'post_args' => array(
@@ -164,6 +179,54 @@ class Test_Automatically_Paginate_Posts extends WP_UnitTestCase {
'num_words' => 2,
),
),
'Classic post, three pages, split to pages' => array(
"1<!--nextpage-->\r\n\r\n2<!--nextpage-->\r\n\r\n3",
array(
'post_args' => array(
'post_type' => 'post',
'post_content' => "1\r\n\r\n2\r\n\r\n3",
),
'type' => 'pages',
'num_pages' => 3,
'num_words' => 2,
),
),
'Classic post, one page, split on words' => array(
"1\r\n\r\n2\r\n\r\n3\r\n\r\n4",
array(
'post_args' => array(
'post_type' => 'post',
'post_content' => "1\r\n\r\n2\r\n\r\n3\r\n\r\n4",
),
'type' => 'words',
'num_pages' => 2,
'num_words' => 5,
),
),
'Classic post, two pages, split on words' => array(
"1\r\n\r\n2<!--nextpage-->\r\n\r\n3\r\n\r\n4",
array(
'post_args' => array(
'post_type' => 'post',
'post_content' => "1\r\n\r\n2\r\n\r\n3\r\n\r\n4",
),
'type' => 'words',
'num_pages' => 2,
'num_words' => 2,
),
),
'Classic post, three pages, split on words' => array(
"1<!--nextpage-->\r\n\r\n2<!--nextpage-->\r\n\r\n3<!--nextpage-->\r\n\r\n4",
array(
'post_args' => array(
'post_type' => 'post',
'post_content' => "1\r\n\r\n2\r\n\r\n3\r\n\r\n4",
),
'type' => 'words',
'num_pages' => 2,
'num_words' => 1,
),
),
);
}
}
Loading