WordPress.org

Make WordPress Core

Changeset 37563


Ignore:
Timestamp:
05/25/2016 06:20:24 PM (3 years ago)
Author:
boonebgorges
Message:

Add tests for get_bookmarks() cache.

This changeset adds a unit test factory so that bookmark/link fixtures can be
created during tests.

Why are we writing tests for functionality that has been deprecated for years?
Because it's the Right Thing to Do.

See #18356.

Location:
trunk/tests/phpunit
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory.php

    r36409 r37563  
    33require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-thing.php' );
    44require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-post.php' );
     5require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-bookmark.php' );
    56require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-attachment.php' );
    67require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-user.php' );
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory.php

    r36854 r37563  
    4444
    4545    /**
     46     * @since 4.6.0
     47     * @var WP_UnitTest_Factory_For_Bookmark
     48     */
     49    public $bookmark;
     50
     51    /**
    4652     * @var WP_UnitTest_Factory_For_Blog
    4753     */
     
    6167        $this->category = new WP_UnitTest_Factory_For_Term( $this, 'category' );
    6268        $this->tag = new WP_UnitTest_Factory_For_Term( $this, 'post_tag' );
     69        $this->bookmark = new WP_UnitTest_Factory_For_Bookmark( $this );
    6370        if ( is_multisite() ) {
    6471            $this->blog = new WP_UnitTest_Factory_For_Blog( $this );
Note: See TracChangeset for help on using the changeset viewer.