Changeset 53238 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 04/21/2022 06:02:21 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r52389 r53238 1687 1687 1688 1688 /** 1689 * Ensures sticking a post succeeds after deleting the 'sticky_posts' option. 1690 * 1691 * @ticket 52007 1692 * @ticket 55176 1693 * @covers ::stick_post 1694 */ 1695 public function test_stick_post_after_delete_sticky_posts_option() { 1696 delete_option( 'sticky_posts' ); 1697 1698 stick_post( 1 ); 1699 $this->assertSameSets( array( 1 ), get_option( 'sticky_posts' ) ); 1700 } 1701 1702 /** 1703 * Ensures sticking works with an unexpected option value. 1704 * 1705 * @ticket 52007 1706 * @ticket 55176 1707 * @covers ::stick_post 1708 * @dataProvider data_stick_post_with_unexpected_sticky_posts_option 1709 * 1710 * @param mixed $starting_option Starting value for sticky_posts option. 1711 */ 1712 public function test_stick_post_with_unexpected_sticky_posts_option( $starting_option ) { 1713 update_option( 'sticky_posts', $starting_option ); 1714 1715 stick_post( 1 ); 1716 $this->assertSameSets( array( 1 ), get_option( 'sticky_posts' ) ); 1717 } 1718 1719 /** 1720 * Data provider. 1721 * 1722 * @return array 1723 */ 1724 public function data_stick_post_with_unexpected_sticky_posts_option() { 1725 return array( 1726 'false' => array( false ), 1727 'a string' => array( 'string' ), 1728 '1 int' => array( 1 ), 1729 'null' => array( null ), 1730 'true' => array( true ), 1731 'an object' => array( new stdClass ), 1732 ); 1733 } 1734 1735 /** 1689 1736 * Ensure sticking a post removes other duplicate post IDs from the option. 1690 1737 *
Note: See TracChangeset
for help on using the changeset viewer.