Skip to content

Commit a2e7f43

Browse files
committed
Tests: Update hyphenation tests for new German pattern file
1 parent 57b9e48 commit a2e7f43

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

tests/class-hyphenator-test.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file is part of PHP-Typography.
44
*
5-
* Copyright 2016-2020 Peter Putzer.
5+
* Copyright 2016-2022 Peter Putzer.
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -261,10 +261,8 @@ public function test_set_custom_exceptions_unknown_encoding() {
261261
public function provide_hyphenate_data() {
262262
return [
263263
[ 'A few words to hyphenate like KINGdesk Really there should be more hyphenation here', 'A few words to hy|phen|ate like KING|desk Re|al|ly there should be more hy|phen|ation here', 'en-US', true ], // fake tokenizer doesn't split off punctuation.
264-
// Not working with newer de pattern file: [ 'Sauerstofffeldflasche', 'Sau|er|stoff|feld|fla|sche', 'de', true ],.
265-
[ 'Sauerstofffeldflasche', 'Sauer|stoff|feld|fla|sche', 'de', true ],
266-
// Not working with newer de pattern file: [ 'Sauerstoff Feldflasche', 'Sau|er|stoff Feld|fla|sche', 'de', true ],.
267-
[ 'Sauerstoff Feldflasche', 'Sauer|stoff Feld|fla|sche', 'de', true ], // Compound words would not be hyphenated separately.
264+
[ 'Sauerstofffeldflasche', 'Sau|er|stoff|feld|fla|sche', 'de', true ],
265+
[ 'Sauerstoff Feldflasche', 'Sau|er|stoff Feld|fla|sche', 'de', true ], // Compound words would not be hyphenated separately.
268266
[ 'Sauerstoff-Feldflasche', 'Sauerstoff-Feldflasche', 'de', false ],
269267
[ 'A', 'A', 'de', true ],
270268
[ 'table', 'ta|ble', 'en-US', false ],

tests/class-php-typography-test.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,10 +2726,8 @@ public function test_style_initial_quotes_off( $html, $result, $is_title ) {
27262726
public function provide_hyphenate_data() {
27272727
return [
27282728
[ 'A few words to hyphenate, like KINGdesk. Really, there should be more hyphenation here!', 'A few words to hy­phen­ate, like KING­desk. Re­al­ly, there should be more hy­phen­ation here!', 'en-US', true, true, true, false ],
2729-
// Not working with new de pattern file: [ 'Sauerstofffeldflasche', 'Sau­er­stoff­feld­fla­sche', 'de', true, true, true, false ],.
2730-
[ 'Sauerstofffeldflasche', 'Sauer­stoff­feld­fla­sche', 'de', true, true, true, false ],
2731-
// Not working with new de pattern file: [ 'Sauerstoff-Feldflasche', 'Sau­er­stoff-Feld­fla­sche', 'de', true, true, true, true ],.
2732-
[ 'Sauerstoff-Feldflasche', 'Sauer­stoff-Feld­fla­sche', 'de', true, true, true, true ],
2729+
[ 'Sauerstofffeldflasche', 'Sau­er­stoff­feld­fla­sche', 'de', true, true, true, false ],
2730+
[ 'Sauerstoff-Feldflasche', 'Sau­er­stoff-Feld­fla­sche', 'de', true, true, true, true ],
27332731
[ 'Sauerstoff-Feldflasche', 'Sauerstoff-Feldflasche', 'de', true, true, true, false ],
27342732
[ 'Geschäftsübernahme', 'Ge­schäfts­über­nah­me', 'de', true, true, true, false ],
27352733
[ 'Trinkwasserinstallation', 'Trink­was­ser­in­stal­la­ti­on', 'de', true, true, true, false ],

tests/fixes/token-fixes/class-hyphenate-compounds-fix-test.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file is part of PHP-Typography.
44
*
5-
* Copyright 2015-2020 Peter Putzer.
5+
* Copyright 2015-2022 Peter Putzer.
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -77,8 +77,7 @@ public function test_constructor() {
7777
*/
7878
public function provide_hyphenate_data() {
7979
return [
80-
// Not working with new de pattern file: [ 'Sauerstoff-Feldflasche', 'Sau­er­stoff-Feld­fla­sche', 'de', true, true, true, true ],.
81-
[ 'Sauerstoff-Feldflasche', 'Sauer­stoff-Feld­fla­sche', 'de', true, true, true, true ],
80+
[ 'Sauerstoff-Feldflasche', 'Sau­er­stoff-Feld­fla­sche', 'de', true, true, true, true ],
8281
[ 'Sauerstoff-Feldflasche', 'Sauerstoff-Feldflasche', 'de', true, true, true, false ],
8382
];
8483
}

tests/fixes/token-fixes/class-hyphenate-fix-test.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file is part of PHP-Typography.
44
*
5-
* Copyright 2015-2020 Peter Putzer.
5+
* Copyright 2015-2022 Peter Putzer.
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -220,9 +220,7 @@ public function test_set_hyphenator_cache() {
220220
public function provide_hyphenate_data() {
221221
return [
222222
[ 'A few words to hyphenate, like KINGdesk Really, there should be more hyphenation here!', 'A few words to hy­phen­ate, like KING­desk Re­al­ly, there should be more hy­phen­ation here!', 'en-US', true, true, true, 'p' ],
223-
// Not working with new de pattern file: [ 'Sauerstofffeldflasche', 'Sau­er­stoff­feld­fla­sche', 'de', true, true, true, false ],.
224-
[ 'Sauerstofffeldflasche', 'Sauer­stoff­feld­fla­sche', 'de', true, true, true, 'p' ],
225-
// Not working with new de pattern file: [ 'Sauerstoff-Feldflasche', 'Sau­er­stoff-Feld­fla­sche', 'de', true, true, true, true ],.
223+
[ 'Sauerstofffeldflasche', 'Sau­er­stoff­feld­fla­sche', 'de', true, true, true, 'p' ],
226224
[ 'Geschäftsübernahme', 'Ge­schäfts­über­nah­me', 'de', true, true, true, 'p' ],
227225
[ 'Trinkwasserinstallation', 'Trink­was­ser­in­stal­la­ti­on', 'de', true, true, true, 'p' ],
228226
[ 'Trinkwasserinstallation', 'Trink­was­ser­in­stal­la­ti­on', 'de', true, true, true, 'h2' ],

0 commit comments

Comments
 (0)