Skip to content
Snippets Groups Projects
bootstrap.php 1.04 KiB
Newer Older
  • Learn to ignore specific revisions
  • Josh Pollock's avatar
    Josh Pollock committed
    <?php
    // phpcs:disable
    /**
     * This is the bootstrap file for Unit Tests -- run using composer unit-tests
     */
    
    //Manually include plugin
    include_once dirname(__FILE__, 2) . '/caldera-forms-query.php';
    
    
    /** Translation compatibility */
    if (! function_exists('translate')) {
    	/**
    	 * @param string $text
    	 * @return string mixed
    	 */
    	function translate($text)
    	{
    		return $text;
    	}
    }
    if (! function_exists('__')) {
    	/**
    	 * @param string $text   Text to translate.
    	 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
    	 *                       Default 'default'.
    	 * @return string Translated text.
    	 */
    	function __($text, $domain = 'default')
    	{
    		return translate($text, $domain);
    	}
    }
    
    //Mock WPDB (not using autoloader so it doesn't load during integration tests
    include_once __DIR__ . '/Mock/wpdb.php';
    //WordPress WPDB constants
    
    Josh Pollock's avatar
    Josh Pollock committed
    if ( ! defined( 'ARRAY_A')) {
    	define('OBJECT', 'OBJECT');
    	define('object', 'OBJECT');
    	define('OBJECT_K', 'OBJECT_K');
    	define('ARRAY_A', 'ARRAY_A');
    	define('ARRAY_N', 'ARRAY_N');
    }