| 1689 | * Ensures sticking a post after delete 'sticky_posts' option. |
| 1690 | * |
| 1691 | * @ticket 52007 |
| 1692 | * @ticket 55176 |
| 1693 | * @covers ::stick_post |
| 1694 | * @dataProvider data_stick_post_after_delete_sticky_posts_option |
| 1695 | * |
| 1696 | * @param mixed $stick Value to pass to stick_post(). |
| 1697 | */ |
| 1698 | public function test_stick_post_after_delete_sticky_posts_option( $stick ) { |
| 1699 | delete_option('sticky_posts'); |
| 1700 | |
| 1701 | stick_post( $stick ); |
| 1702 | $this->assertSameSets( array( 1 ), get_option( 'sticky_posts' ) ); |
| 1703 | } |
| 1704 | |
| 1705 | /** |
| 1706 | * Data provider for test_stick_post_after_delete_sticky_posts_option(). |
| 1707 | * |
| 1708 | * @return array[] { |
| 1709 | * Arguments passed to test. |
| 1710 | * |
| 1711 | * @type mixed $stick Value to pass to stick_post(). |
| 1712 | * } |
| 1713 | */ |
| 1714 | public function data_stick_post_after_delete_sticky_posts_option() { |
| 1715 | return array( |
| 1716 | array( 1 ), |
| 1717 | ); |
| 1718 | } |
| 1719 | |
| 1720 | /** |