public static function cloneDB() {

		// Don't do this too often
		if( ! self::$bCloned ) {

			self::copyFromLive( 'blogs' );
			self::copyFromLive( 'blog_versions' );
			self::copyFromLive( 'commentmeta' );
			self::copyFromLive( 'comments' );
			self::copyFromLive( 'links' );
			self::copyFromLive( 'options' );
			self::copyFromLive( 'postmeta' );
			self::copyFromLive( 'posts' );
			self::copyFromLive( 'pro_sites' );
			self::copyFromLive( 'pro_sites_daily_stats' );
			self::copyFromLive( 'pro_sites_signup_stats' );
			self::copyFromLive( 'registration_log' );
			self::copyFromLive( 'signups' );
			self::copyFromLive( 'site' );
			self::copyFromLive( 'sitemeta' );
			self::copyFromLive( 'terms' );
			self::copyFromLive( 'term_relationships' );
			self::copyFromLive( 'term_taxonomy' );
			self::copyFromLive( 'usermeta' );
			self::copyFromLive( 'users' );
		}

		self::$bCloned = true;
	}
Esempio n. 2
0
	function test_get_adjusted_level_amounts() {

		ProSitesTestsUtility::cloneDB();

		$test_coupons = array( 'AL0U0P0', 'ABC', 'PL0U0P312', 'PL1U10P312', 'PL2U0P112', 'PL3U0P13' );

		foreach( $test_coupons as $coupon ) {
			echo $coupon . "\n";
			$level_list = ProSites_Helper_Coupons::get_adjusted_level_amounts( $coupon );
			$expected_level_list = $this->_get_expected( $coupon, $level_list );
			$this->assertEquals( $expected_level_list, $level_list );
		}

	}