| | 1 | <?php |
| | 2 | |
| | 3 | class Tests_General_Template extends WP_UnitTestCase { |
| | 4 | |
| | 5 | private $i18n_count = 0; |
| | 6 | |
| | 7 | function increment_i18n_count() { |
| | 8 | $this->i18n_count += 1; |
| | 9 | } |
| | 10 | |
| | 11 | function test_paginate_links_number_format() { |
| | 12 | $this->i18n_count = 0; |
| | 13 | add_filter( 'number_format_i18n', array( $this, 'increment_i18n_count' ) ); |
| | 14 | paginate_links( array( |
| | 15 | 'total' => 100, |
| | 16 | 'current' => 50, |
| | 17 | 'show_all' => false, |
| | 18 | 'prev_next' => true, |
| | 19 | 'end_size' => 1, |
| | 20 | 'mid_size' => 1, |
| | 21 | ) ); |
| | 22 | // The links should be: |
| | 23 | // < Previous 1 ... 49 50 51 ... 100 Next > |
| | 24 | $this->assertEquals( 5, $this->i18n_count ); |
| | 25 | } |
| | 26 | |
| | 27 | } |