Changeset 43571 for trunk/tests/phpunit/tests/multisite/site.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/site.php
r43548 r43571 10 10 */ 11 11 class Tests_Multisite_Site extends WP_UnitTestCase { 12 protected $suppress = false;12 protected $suppress = false; 13 13 protected $site_status_hooks = array(); 14 14 protected static $network_ids; … … 1460 1460 public function test_wp_update_site_cleans_cache() { 1461 1461 $site_id = self::factory()->blog->create(); 1462 $site1 = get_site( $site_id );1462 $site1 = get_site( $site_id ); 1463 1463 1464 1464 $result = wp_update_site( $site_id, array( 'public' => 0 ) ); 1465 $site2 = get_site( $site_id );1465 $site2 = get_site( $site_id ); 1466 1466 1467 1467 $result = wp_update_site( $site_id, array( 'public' => 1 ) ); 1468 $site3 = get_site( $site_id );1468 $site3 = get_site( $site_id ); 1469 1469 1470 1470 $this->assertEquals( 1, $site1->public ); … … 1710 1710 public function test_site_dates_are_gmt() { 1711 1711 $first_date = current_time( 'mysql', true ); 1712 $site_id = wp_insert_site( array( 1713 'domain' => 'valid-domain.com', 1714 'path' => '/valid-path/', 1715 'network_id' => 1, 1716 ) ); 1712 $site_id = wp_insert_site( 1713 array( 1714 'domain' => 'valid-domain.com', 1715 'path' => '/valid-path/', 1716 'network_id' => 1, 1717 ) 1718 ); 1717 1719 $this->assertInternalType( 'integer', $site_id ); 1718 1720 … … 1750 1752 $new_domain = 'new.wordpress.org'; 1751 1753 1752 $site = self::factory()->blog->create_and_get( array( 1753 'domain' => $old_domain, 1754 'path' => '/', 1755 ) ); 1754 $site = self::factory()->blog->create_and_get( 1755 array( 1756 'domain' => $old_domain, 1757 'path' => '/', 1758 ) 1759 ); 1756 1760 1757 1761 // Populate the caches. 1758 get_blog_details( array( 1759 'domain' => $old_domain, 1760 'path' => '/', 1761 ) ); 1762 get_blog_details( 1763 array( 1764 'domain' => $old_domain, 1765 'path' => '/', 1766 ) 1767 ); 1762 1768 get_blog_id_from_url( $old_domain, '/' ); 1763 get_blog_details( array( 1764 'domain' => $new_domain, 1765 'path' => '/', 1766 ) ); 1769 get_blog_details( 1770 array( 1771 'domain' => $new_domain, 1772 'path' => '/', 1773 ) 1774 ); 1767 1775 get_blog_id_from_url( $new_domain, '/' ); 1768 1776 1769 wp_update_site( $site->id, array( 1770 'domain' => $new_domain, 1771 ) ); 1777 wp_update_site( 1778 $site->id, 1779 array( 1780 'domain' => $new_domain, 1781 ) 1782 ); 1772 1783 1773 1784 $domain_path_key_old = md5( $old_domain . '/' ); … … 1796 1807 $new_path = '/bar/'; 1797 1808 1798 $site = self::factory()->blog->create_and_get( array( 1799 'domain' => 'test.wordpress.org', 1800 'path' => $old_path, 1801 ) ); 1809 $site = self::factory()->blog->create_and_get( 1810 array( 1811 'domain' => 'test.wordpress.org', 1812 'path' => $old_path, 1813 ) 1814 ); 1802 1815 1803 1816 // Populate the caches. 1804 get_blog_details( array( 1805 'domain' => 'test.wordpress.org', 1806 'path' => $old_path, 1807 ) ); 1817 get_blog_details( 1818 array( 1819 'domain' => 'test.wordpress.org', 1820 'path' => $old_path, 1821 ) 1822 ); 1808 1823 get_blog_id_from_url( 'test.wordpress.org', $old_path ); 1809 get_blog_details( array( 1810 'domain' => 'test.wordpress.org', 1811 'path' => $new_path, 1812 ) ); 1824 get_blog_details( 1825 array( 1826 'domain' => 'test.wordpress.org', 1827 'path' => $new_path, 1828 ) 1829 ); 1813 1830 get_blog_id_from_url( 'test.wordpress.org', $new_path ); 1814 1831 1815 wp_update_site( $site->id, array( 1816 'path' => $new_path, 1817 ) ); 1832 wp_update_site( 1833 $site->id, 1834 array( 1835 'path' => $new_path, 1836 ) 1837 ); 1818 1838 1819 1839 $domain_path_key_old = md5( 'test.wordpress.org' . $old_path ); … … 1841 1861 $this->listen_to_site_status_hooks(); 1842 1862 1843 $site_data = array_merge( array( 1844 'domain' => 'example-site.com', 1845 'path' => '/', 1846 ), $insert_site_data ); 1863 $site_data = array_merge( 1864 array( 1865 'domain' => 'example-site.com', 1866 'path' => '/', 1867 ), 1868 $insert_site_data 1869 ); 1847 1870 1848 1871 $site_id = wp_insert_site( $site_data );
Note: See TracChangeset
for help on using the changeset viewer.