Make WordPress Core

Ticket #21221: unit_tests_21221.diff

File unit_tests_21221.diff, 1.1 KB (added by welcher, 10 years ago)

First pass unit test

  • tests/phpunit/tests/formatting/WPTexturize.php

     
    18371837                        ),
    18381838                );
    18391839        }
     1840
     1841        /**
     1842         * @ticket 21221
     1843         * @dataProvider data_image_title_tags
     1844         */
     1845
     1846        function test_image_alt_tag( $input, $output) {
     1847
     1848                $image = get_image_tag( 1 , $input, 'title', 'left' );
     1849                return $this->assertEquals( '<img src="" alt="'. $output.'" title="title" class="alignleft size-medium wp-image-1" />' , $image );
     1850
     1851        }
     1852
     1853        /**
     1854         * @ticket 21221
     1855         * @dataProvider data_image_title_tags
     1856         */
     1857
     1858        function test_image_title_tag( $input, $output) {
     1859
     1860                $image = get_image_tag( 1 , 'alt', $input, 'left' );
     1861                return $this->assertEquals( '<img src="" alt="alt" title="'. $output.'" class="alignleft size-medium wp-image-1" />' , $image );
     1862        }
     1863
     1864        function data_image_title_tags() {
     1865                return array_merge(
     1866                        $this->data_apos_before_digits(),
     1867                        $this->data_spaces_around_quotes(),
     1868                        $this->data_year_abbr()
     1869                );
     1870        }
    18401871}
     1872 No newline at end of file