|
@@ 1559-1568 (lines=10) @@
|
| 1556 |
|
* @ticket 27426 |
| 1557 |
|
* @dataProvider data_translate |
| 1558 |
|
*/ |
| 1559 |
|
function test_translate( $input, $output ) { |
| 1560 |
|
add_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 ); |
| 1561 |
|
|
| 1562 |
|
$result = wptexturize( $input, true ); |
| 1563 |
|
|
| 1564 |
|
remove_filter( 'gettext_with_context', array( $this, 'filter_translate' ), 10, 4 ); |
| 1565 |
|
wptexturize( 'reset', true ); |
| 1566 |
|
|
| 1567 |
|
return $this->assertEquals( $output, $result ); |
| 1568 |
|
} |
| 1569 |
|
|
| 1570 |
|
function filter_translate( $translations, $text, $context, $domain ) { |
| 1571 |
|
switch ($text) { |
|
@@ 1976-1985 (lines=10) @@
|
| 1973 |
|
* @ticket 29256 |
| 1974 |
|
* @dataProvider data_primes_quotes_translation |
| 1975 |
|
*/ |
| 1976 |
|
function test_primes_quotes_translation( $input, $output ) { |
| 1977 |
|
add_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 ); |
| 1978 |
|
|
| 1979 |
|
$result = wptexturize( $input, true ); |
| 1980 |
|
|
| 1981 |
|
remove_filter( 'gettext_with_context', array( $this, 'filter_translate2' ), 10, 4 ); |
| 1982 |
|
wptexturize( 'reset', true ); |
| 1983 |
|
|
| 1984 |
|
return $this->assertEquals( $output, $result ); |
| 1985 |
|
} |
| 1986 |
|
|
| 1987 |
|
function filter_translate2( $translations, $text, $context, $domain ) { |
| 1988 |
|
switch ($text) { |