Make WordPress Core


Ignore:
Timestamp:
12/19/2021 04:23:38 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use shared fixtures in block theme tests.

This removes duplicate test data and aims to avoid future confusion about which themes to use in which tests.

Follow-up to [52049], [52246], [52247], [52279].

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/wpTheme.php

    r52386 r52391  
    274274                        ),
    275275                        'parent block theme'        => array(
    276                                 'theme_dir' => 'test-block-theme',
     276                                'theme_dir' => 'block-theme',
    277277                                'expected'  => true,
    278278                        ),
    279279                        'child block theme'         => array(
    280                                 'theme_dir' => 'test-block-child-theme',
     280                                'theme_dir' => 'block-theme-child',
    281281                                'expected'  => true,
    282282                        ),
     
    313313                        ),
    314314                        'parent theme: no file given'       => array(
    315                                 'theme_dir' => 'test-block-theme',
     315                                'theme_dir' => 'block-theme',
    316316                                'file'      => '',
    317                                 'expected'  => '/test-block-theme',
     317                                'expected'  => '/block-theme',
    318318                        ),
    319319                        'child theme: no file given'        => array(
    320                                 'theme_dir' => 'test-block-child-theme',
     320                                'theme_dir' => 'block-theme-child',
    321321                                'file'      => '',
    322                                 'expected'  => '/test-block-child-theme',
     322                                'expected'  => '/block-theme-child',
    323323                        ),
    324324                        'nonexistent theme: file given'     => array(
     
    328328                        ),
    329329                        'parent theme: file exists'         => array(
    330                                 'theme_dir' => 'test-block-theme',
     330                                'theme_dir' => 'block-theme',
    331331                                'file'      => '/templates/page-home.html',
    332                                 'expected'  => '/test-block-theme/templates/page-home.html',
     332                                'expected'  => '/block-theme/templates/page-home.html',
    333333                        ),
    334334                        'parent theme: file does not exist' => array(
    335                                 'theme_dir' => 'test-block-theme',
     335                                'theme_dir' => 'block-theme',
    336336                                'file'      => '/templates/nonexistent.html',
    337                                 'expected'  => '/test-block-theme/templates/nonexistent.html',
     337                                'expected'  => '/block-theme/templates/nonexistent.html',
    338338                        ),
    339339                        'child theme: file exists'          => array(
    340                                 'theme_dir' => 'test-block-child-theme',
     340                                'theme_dir' => 'block-theme-child',
    341341                                'file'      => '/templates/page-1.html',
    342                                 'expected'  => '/test-block-child-theme/templates/page-1.html',
     342                                'expected'  => '/block-theme-child/templates/page-1.html',
    343343                        ),
    344344                        'child theme: file does not exist'  => array(
    345                                 'theme_dir' => 'test-block-child-theme',
     345                                'theme_dir' => 'block-theme-child',
    346346                                'file'      => '/templates/nonexistent.html',
    347                                 'expected'  => '/test-block-theme/templates/nonexistent.html',
     347                                'expected'  => '/block-theme/templates/nonexistent.html',
    348348                        ),
    349349                        'child theme: file exists in parent, not in child' => array(
    350                                 'theme_dir' => 'test-block-child-theme',
     350                                'theme_dir' => 'block-theme-child',
    351351                                'file'      => '/templates/page.html',
    352                                 'expected'  => '/test-block-theme/templates/page.html',
     352                                'expected'  => '/block-theme/templates/page.html',
    353353                        ),
    354354                );
Note: See TracChangeset for help on using the changeset viewer.