Make WordPress Core


Ignore:
Timestamp:
07/27/2022 04:27:18 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use named data providers in some wp_insert_post() tests.

Follow-up to [42380], [49125], [53521], [53785], [53787], [53788].

See #55652.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/wpInsertPost.php

    r53788 r53789  
    688688                $post_id = self::factory()->post->create(
    689689                        array(
    690                                 'post_status'  => 'publish',
     690                                'post_status' => 'publish',
    691691                        )
    692692                );
    … …  
    703703                $post_id = self::factory()->post->create(
    704704                        array(
    705                                 'post_status'  => 'publish',
    706                                 'post_type'    => 'page',
     705                                'post_status' => 'publish',
     706                                'post_type'   => 'page',
    707707                        )
    708708                );
    … …  
    13471347         */
    13481348        public function data_various_post_types() {
    1349                 return array(
    1350                         array(
    1351                                 'mapped_meta_caps',
    1352                         ),
    1353                         array(
    1354                                 'unmapped_meta_caps',
    1355                         ),
    1356                         array(
    1357                                 'post',
    1358                         ),
    1359                 );
     1349                $post_types = array(
     1350                        'mapped_meta_caps',
     1351                        'unmapped_meta_caps',
     1352                        'post',
     1353                );
     1354
     1355                return $this->text_array_to_dataprovider( $post_types );
    13601356        }
    13611357
    … …  
    13661362         */
    13671363        public function data_various_post_statuses() {
    1368                 return array(
    1369                         array(
    1370                                 'draft',
    1371                         ),
    1372                         array(
    1373                                 'pending',
    1374                         ),
    1375                         array(
    1376                                 'private',
    1377                         ),
    1378                         array(
    1379                                 'publish',
    1380                         ),
    1381                 );
     1364                $post_statuses = array(
     1365                        'draft',
     1366                        'pending',
     1367                        'private',
     1368                        'publish',
     1369                );
     1370
     1371                return $this->text_array_to_dataprovider( $post_statuses );
    13821372        }
    13831373
Note: See TracChangeset for help on using the changeset viewer.