@@ 566-573 (lines=8) @@ | ||
563 | /** |
|
564 | * Test that a single short paragraph turns into one tweet. |
|
565 | */ |
|
566 | public function test_single_paragraph() { |
|
567 | $test_content = 'This is some content.'; |
|
568 | $blocks = array( |
|
569 | $this->generateParagraphData( $test_content ), |
|
570 | ); |
|
571 | ||
572 | $this->assertTweetGenerated( $blocks, array( $test_content ), array( false ), array( $blocks ) ); |
|
573 | } |
|
574 | ||
575 | /** |
|
576 | * Test that multiple short paragraphs are joined together into one tweet. |
|
@@ 631-643 (lines=13) @@ | ||
628 | /** |
|
629 | * Test that a single long paragraph is split into two tweets, breaking at the end of a sentence. |
|
630 | */ |
|
631 | public function test_line_break_is_preserved() { |
|
632 | $test_content = "First line.\nsecond line."; |
|
633 | $blocks = array( |
|
634 | $this->generateParagraphData( $test_content ), |
|
635 | ); |
|
636 | ||
637 | $this->assertTweetGenerated( |
|
638 | $blocks, |
|
639 | array( $test_content ), |
|
640 | array( false ), |
|
641 | array( $blocks ) |
|
642 | ); |
|
643 | } |
|
644 | ||
645 | /** |
|
646 | * Test that a single long paragraph containing multibyte characters is split into two tweets, |
|
@@ 930-942 (lines=13) @@ | ||
927 | /** |
|
928 | * Test that a basic verse maintains spacing. |
|
929 | */ |
|
930 | public function test_basic_verse() { |
|
931 | $test_content = " They say that code \n is poetry.\n\n Is indentation poetry,\n too?"; |
|
932 | ||
933 | $blocks = array( |
|
934 | $this->generateVerseData( $test_content ), |
|
935 | ); |
|
936 | ||
937 | $expected_text = array( |
|
938 | " They say that code\n is poetry.\n\n Is indentation poetry,\n too?", |
|
939 | ); |
|
940 | ||
941 | $this->assertTweetGenerated( $blocks, $expected_text, array( false ), array( $blocks ) ); |
|
942 | } |
|
943 | ||
944 | /** |
|
945 | * Test that a long verse splits correctly. |
|
@@ 1197-1210 (lines=14) @@ | ||
1194 | /** |
|
1195 | * Test that an assortment of blank lines in a list are ignored. |
|
1196 | */ |
|
1197 | public function test_blank_list_items() { |
|
1198 | $test_content = 'This is 22 characters.'; |
|
1199 | ||
1200 | $blocks = array( |
|
1201 | $this->generateListData( "<li></li><li></li><li><li></li><li>$test_content</li></li><li></li><li>$test_content</li>" ), |
|
1202 | ); |
|
1203 | ||
1204 | $this->assertTweetGenerated( |
|
1205 | $blocks, |
|
1206 | array( "- $test_content\n- $test_content" ), |
|
1207 | array( false ), |
|
1208 | array( $blocks ) |
|
1209 | ); |
|
1210 | } |
|
1211 | ||
1212 | /** |
|
1213 | * Test that a simple quote block renders correctly. |