Skip to content

Commit

Permalink
Tests: Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored and mundschenk-at committed May 20, 2024
1 parent c7b5649 commit 039a877
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 34 deletions.
22 changes: 11 additions & 11 deletions tests/class-php-typography-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ public function provide_smart_ellipses_data() {
*
* @dataProvider provide_smart_ellipses_data
*
* @param string $input HTML intput.
* @param string $input HTML input.
* @param string $result Expected result.
*/
public function test_smart_ellipses( $input, $result ) {
Expand All @@ -1038,7 +1038,7 @@ public function test_smart_ellipses( $input, $result ) {
*
* @dataProvider provide_smart_ellipses_data
*
* @param string $input HTML intput.
* @param string $input HTML input.
* @param string $result Ignored.
*/
public function test_smart_ellipses_off( $input, $result ) {
Expand Down Expand Up @@ -2761,9 +2761,9 @@ public function provide_hyphenate_data() {
* @param bool $hyphenate_headings Hyphenate headings.
* @param bool $hyphenate_all_caps Hyphenate words in ALL caps.
* @param bool $hyphenate_title_case Hyphenate words in Title Case.
* @param bool $hyphenate_compunds Hyphenate compound-words.
* @param bool $hyphenate_compounds Hyphenate compound-words.
*/
public function test_hyphenate_off( $html, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) {
public function test_hyphenate_off( $html, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compounds ) {
$this->s->set_hyphenation( false );
$this->s->set_hyphenation_language( $lang );
$this->s->set_min_length_hyphenation( 2 );
Expand All @@ -2772,7 +2772,7 @@ public function test_hyphenate_off( $html, $result, $lang, $hyphenate_headings,
$this->s->set_hyphenate_headings( $hyphenate_headings );
$this->s->set_hyphenate_all_caps( $hyphenate_all_caps );
$this->s->set_hyphenate_title_case( $hyphenate_title_case );
$this->s->set_hyphenate_compounds( $hyphenate_compunds );
$this->s->set_hyphenate_compounds( $hyphenate_compounds );
$this->s->set_hyphenation_exceptions( [ 'KING-desk' ] );

$this->assertSame( $html, $this->typo->process( $html, $this->s ) );
Expand All @@ -2797,9 +2797,9 @@ public function test_hyphenate_off( $html, $result, $lang, $hyphenate_headings,
* @param bool $hyphenate_headings Hyphenate headings.
* @param bool $hyphenate_all_caps Hyphenate words in ALL caps.
* @param bool $hyphenate_title_case Hyphenate words in Title Case.
* @param bool $hyphenate_compunds Hyphenate compound-words.
* @param bool $hyphenate_compounds Hyphenate compound-words.
*/
public function test_hyphenate( $html, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) {
public function test_hyphenate( $html, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compounds ) {
$this->s->set_hyphenation( true );
$this->s->set_hyphenation_language( $lang );
$this->s->set_min_length_hyphenation( 2 );
Expand All @@ -2808,7 +2808,7 @@ public function test_hyphenate( $html, $result, $lang, $hyphenate_headings, $hyp
$this->s->set_hyphenate_headings( $hyphenate_headings );
$this->s->set_hyphenate_all_caps( $hyphenate_all_caps );
$this->s->set_hyphenate_title_case( $hyphenate_title_case );
$this->s->set_hyphenate_compounds( $hyphenate_compunds );
$this->s->set_hyphenate_compounds( $hyphenate_compounds );
$this->s->set_hyphenation_exceptions( [ 'KING-desk' ] );

$this->assertSame( $result, $this->clean_html( $this->typo->process( $html, $this->s ) ) );
Expand Down Expand Up @@ -2849,9 +2849,9 @@ public function provide_hyphenate_with_exceptions_data() {
* @param bool $hyphenate_headings Hyphenate headings.
* @param bool $hyphenate_all_caps Hyphenate words in ALL caps.
* @param bool $hyphenate_title_case Hyphenate words in Title Case.
* @param bool $hyphenate_compunds Hyphenate compound-words.
* @param bool $hyphenate_compounds Hyphenate compound-words.
*/
public function test_hyphenate_with_exceptions( $html, $result, $exceptions, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) {
public function test_hyphenate_with_exceptions( $html, $result, $exceptions, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compounds ) {
$this->s->set_hyphenation( true );
$this->s->set_hyphenation_language( $lang );
$this->s->set_min_length_hyphenation( 2 );
Expand All @@ -2860,7 +2860,7 @@ public function test_hyphenate_with_exceptions( $html, $result, $exceptions, $la
$this->s->set_hyphenate_headings( $hyphenate_headings );
$this->s->set_hyphenate_all_caps( $hyphenate_all_caps );
$this->s->set_hyphenate_title_case( $hyphenate_title_case );
$this->s->set_hyphenate_compounds( $hyphenate_compunds );
$this->s->set_hyphenate_compounds( $hyphenate_compounds );
$this->s->set_hyphenation_exceptions( $exceptions );

$this->assertSame( $result, $this->clean_html( $this->typo->process( $html, $this->s ) ) );
Expand Down
30 changes: 15 additions & 15 deletions tests/class-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,77 +169,77 @@ protected function assert_smart_quotes_style( $style, $open, $close ) {
switch ( $style ) {
case 'doubleCurled':
$this->assertSame( U::DOUBLE_QUOTE_OPEN, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'doubleCurledReversed':
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'doubleLow9':
$this->assertSame( U::DOUBLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'doubleLow9Reversed':
$this->assertSame( U::DOUBLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_OPEN, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::DOUBLE_QUOTE_OPEN, $close, "Closing quote $close did not match quote style $style." );
break;

case 'singleCurled':
$this->assertSame( U::SINGLE_QUOTE_OPEN, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'singleCurledReversed':
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'singleLow9':
$this->assertSame( U::SINGLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'singleLow9Reversed':
$this->assertSame( U::SINGLE_LOW_9_QUOTE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_OPEN, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::SINGLE_QUOTE_OPEN, $close, "Closing quote $close did not match quote style $style." );
break;

case 'doubleGuillemetsFrench':
$this->assertSame( U::GUILLEMET_OPEN . U::NO_BREAK_NARROW_SPACE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::NO_BREAK_NARROW_SPACE . U::GUILLEMET_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::NO_BREAK_NARROW_SPACE . U::GUILLEMET_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'doubleGuillemets':
$this->assertSame( U::GUILLEMET_OPEN, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::GUILLEMET_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::GUILLEMET_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'doubleGuillemetsReversed':
$this->assertSame( U::GUILLEMET_CLOSE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::GUILLEMET_OPEN, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::GUILLEMET_OPEN, $close, "Closing quote $close did not match quote style $style." );
break;

case 'singleGuillemets':
$this->assertSame( U::SINGLE_ANGLE_QUOTE_OPEN, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::SINGLE_ANGLE_QUOTE_CLOSE, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::SINGLE_ANGLE_QUOTE_CLOSE, $close, "Closing quote $close did not match quote style $style." );
break;

case 'singleGuillemetsReversed':
$this->assertSame( U::SINGLE_ANGLE_QUOTE_CLOSE, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::SINGLE_ANGLE_QUOTE_OPEN, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::SINGLE_ANGLE_QUOTE_OPEN, $close, "Closing quote $close did not match quote style $style." );
break;

case 'cornerBrackets':
$this->assertSame( U::LEFT_CORNER_BRACKET, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::RIGHT_CORNER_BRACKET, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::RIGHT_CORNER_BRACKET, $close, "Closing quote $close did not match quote style $style." );
break;

case 'whiteCornerBracket':
$this->assertSame( U::LEFT_WHITE_CORNER_BRACKET, $open, "Opening quote $open did not match quote style $style." );
$this->assertSame( U::RIGHT_WHITE_CORNER_BRACKET, $close, "Closeing quote $close did not match quote style $style." );
$this->assertSame( U::RIGHT_WHITE_CORNER_BRACKET, $close, "Closing quote $close did not match quote style $style." );
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion tests/fixes/class-registry-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function test_register_token_fix() {
$this->pw_fix->shouldReceive( 'register_token_fix' )->once()->with( $fake_token_fixer );

$this->r->register_token_fix( $fake_token_fixer );
$this->assertTrue( true, 'An error occured during Token_Fix registration.' );
$this->assertTrue( true, 'An error occurred during Token_Fix registration.' );
}

/**
Expand Down
14 changes: 7 additions & 7 deletions tests/fixes/token-fixes/class-hyphenate-compounds-fix-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function set_up() {
public function test_constructor() {
$fix = new Token_Fixes\Hyphenate_Compounds_Fix( null, true );

$this->assert_attribute_same( Token_Fix::COMPOUND_WORDS, 'target', $fix, 'The fixer should be targetting COMPOUND_WORDS tokens.' );
$this->assert_attribute_same( Token_Fix::COMPOUND_WORDS, 'target', $fix, 'The fixer should be targeting COMPOUND_WORDS tokens.' );
$this->assert_attribute_same( true, 'feed_compatible', $fix, 'The fixer should not be feed_compatible.' );
}

Expand Down Expand Up @@ -99,9 +99,9 @@ public function provide_hyphenate_data() {
* @param bool $hyphenate_headings Hyphenate headings.
* @param bool $hyphenate_all_caps Hyphenate words in ALL caps.
* @param bool $hyphenate_title_case Hyphenate words in Title Case.
* @param bool $hyphenate_compunds Hyphenate compound-words.
* @param bool $hyphenate_compounds Hyphenate compound-words.
*/
public function test_apply( $input, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) {
public function test_apply( $input, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compounds ) {
$this->s->set_hyphenation( true );
$this->s->set_hyphenation_language( $lang );
$this->s->set_min_length_hyphenation( 2 );
Expand All @@ -110,7 +110,7 @@ public function test_apply( $input, $result, $lang, $hyphenate_headings, $hyphen
$this->s->set_hyphenate_headings( $hyphenate_headings );
$this->s->set_hyphenate_all_caps( $hyphenate_all_caps );
$this->s->set_hyphenate_title_case( $hyphenate_title_case );
$this->s->set_hyphenate_compounds( $hyphenate_compunds );
$this->s->set_hyphenate_compounds( $hyphenate_compounds );
$this->s->set_hyphenation_exceptions( [ 'KING-desk' ] );

$this->assertFixResultSame( $input, $result, false, $this->getTextnode( 'foo', $input ) );
Expand All @@ -133,9 +133,9 @@ public function test_apply( $input, $result, $lang, $hyphenate_headings, $hyphen
* @param bool $hyphenate_headings Hyphenate headings.
* @param bool $hyphenate_all_caps Hyphenate words in ALL caps.
* @param bool $hyphenate_title_case Hyphenate words in Title Case.
* @param bool $hyphenate_compunds Hyphenate compound-words.
* @param bool $hyphenate_compounds Hyphenate compound-words.
*/
public function test_apply_off( $input, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compunds ) {
public function test_apply_off( $input, $result, $lang, $hyphenate_headings, $hyphenate_all_caps, $hyphenate_title_case, $hyphenate_compounds ) {
$this->s->set_hyphenation( false );
$this->s->set_hyphenation_language( $lang );
$this->s->set_min_length_hyphenation( 2 );
Expand All @@ -144,7 +144,7 @@ public function test_apply_off( $input, $result, $lang, $hyphenate_headings, $hy
$this->s->set_hyphenate_headings( $hyphenate_headings );
$this->s->set_hyphenate_all_caps( $hyphenate_all_caps );
$this->s->set_hyphenate_title_case( $hyphenate_title_case );
$this->s->set_hyphenate_compounds( $hyphenate_compunds );
$this->s->set_hyphenate_compounds( $hyphenate_compounds );
$this->s->set_hyphenation_exceptions( [ 'KING-desk' ] );

$this->assertFixResultSame( $input, $input, false, $this->getTextnode( 'foo', $input ) );
Expand Down

0 comments on commit 039a877

Please sign in to comment.