Make WordPress Core

Ticket #35566: 35566.tests.diff

File 35566.tests.diff, 2.1 KB (added by afercia, 8 years ago)
  • tests/phpunit/tests/post.php

     
    939939                        'link' => 'edit'
    940940                ) );
    941941
    942                 preg_match_all( "|href='([^']+)'|", $wp_tag_cloud, $matches );
     942                preg_match_all( '|href="([^"]+)"|', $wp_tag_cloud, $matches );
    943943                $this->assertSame( 1, count( $matches[1] ) );
    944944
    945945                $terms = get_terms( $tax );
  • tests/phpunit/tests/term/wpGenerateTagCloud.php

     
    119119                        'format'     => 'list',
    120120                ) );
    121121
    122                 $this->assertRegExp( "|^<ul class='wp-tag-cloud'>|", $found );
     122                $this->assertRegExp( "|^<ul class='wp-tag-cloud' role='list'>|", $found );
    123123                $this->assertRegExp( "|</ul>\n|", $found );
    124124                $this->assertContains( '>' . $tags[0]->name . '<', $found );
    125125        }
     
    164164                        'format'     => 'list',
    165165                ) );
    166166
    167                 $this->assertRegExp( "|^<ul class='wp-tag-cloud'>|", $found );
     167                $this->assertRegExp( "|^<ul class='wp-tag-cloud' role='list'>|", $found );
    168168                $this->assertRegExp( "|</ul>\n|", $found );
    169169
    170170                foreach ( $tags as $tag ) {
     
    198198                        ),
    199199                ) );
    200200
    201                 $this->assertContains( "title='Term has 1 post'", $actual[0] );
    202                 $this->assertContains( "title='Term has 2 posts'", $actual[1] );
     201                $this->assertContains( 'aria-label="' . $term_objects[0]->name . ' (Term has 1 post)"', $actual[0] );
     202                $this->assertContains( 'aria-label="' . $term_objects[1]->name . ' (Term has 2 posts)"', $actual[1] );
    203203        }
    204204
    205205        public function test_topic_count_text_callback() {
     
    223223                        'topic_count_text_callback' => array( $this, 'topic_count_text_callback' ),
    224224                ) );
    225225
    226                 $this->assertContains( "title='1 foo'", $actual[0] );
    227                 $this->assertContains( "title='2 foo'", $actual[1] );
     226                $this->assertContains( 'aria-label="' . $term_objects[0]->name . ' (1 foo)"', $actual[0] );
     227                $this->assertContains( 'aria-label="' . $term_objects[1]->name . ' (2 foo)"', $actual[1] );
    228228        }
    229229
    230230        /**