<?php
// Test environment settings
define('WP_TESTS_DOMAIN', 'localhost');
define('WP_TESTS_EMAIL', 'admin@example.com');
define('WP_TESTS_TITLE', 'Test Blog');
define('WP_PHP_BINARY', 'php');

// Database settings
define('DB_NAME', 'wordpress_test');
define('DB_USER', 'uberrxmprk');
define('DB_PASSWORD', 'uberrxmprk');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

// WordPress table prefix
$table_prefix = 'wp_';

// WordPress core location - using absolute path
define('ABSPATH', dirname(dirname(dirname(dirname(__FILE__)))) . '/wordpress/');
define('WP_CONTENT_DIR', ABSPATH . 'wp-content');

// Required paths for testing
define('WP_TESTS_PHPUNIT_POLYFILLS_PATH', dirname(dirname(dirname(__FILE__))) . '/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php');

// Test environment
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);

// Prevent filesystem modifications
define('WP_TESTS_FILESYSTEM_SAFE', true);

// Required for WordPress tests
define('WP_TESTS_FORCE_KNOWN_BUGS', false);
define('WP_TESTS_CONFIG_FILE_PATH', __FILE__);

// Make sure the WordPress core files are accessible
if (!file_exists(ABSPATH . 'wp-includes/PHPMailer/PHPMailer.php')) {
    die('WordPress core files not found at: ' . ABSPATH . "\n");
}

// Load custom test configuration if it exists
if (file_exists(dirname(__FILE__) . '/wp-tests-config-local.php')) {
    require dirname(__FILE__) . '/wp-tests-config-local.php';
}
