chore: add spec-kit and standardize signatures
- Added GitHub spec-kit for development workflow - Standardized file signatures to Descomplicar® format - Updated development configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
57
care-booking-block/tests/bootstrap.php
Normal file
57
care-booking-block/tests/bootstrap.php
Normal file
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Descomplicar® Crescimento Digital
|
||||
* https://descomplicar.pt
|
||||
*/
|
||||
|
||||
<?php
|
||||
/**
|
||||
* PHPUnit bootstrap file for Care Booking Block plugin
|
||||
*
|
||||
* @package CareBookingBlock
|
||||
*/
|
||||
|
||||
// Define test environment
|
||||
define('CARE_BOOKING_BLOCK_TESTS', true);
|
||||
|
||||
// Plugin directory
|
||||
$plugin_dir = dirname(dirname(__FILE__));
|
||||
|
||||
// WordPress test suite directory
|
||||
$wp_tests_dir = getenv('WP_TESTS_DIR') ?: '/tmp/wordpress-tests-lib';
|
||||
|
||||
// WordPress core directory for tests
|
||||
$wp_core_dir = getenv('WP_CORE_DIR') ?: '/tmp/wordpress/';
|
||||
|
||||
// Check if WordPress test suite exists
|
||||
if (!file_exists($wp_tests_dir . '/includes/bootstrap.php')) {
|
||||
echo "WordPress test suite not found at: $wp_tests_dir\n";
|
||||
echo "Please install WordPress test suite or set WP_TESTS_DIR environment variable.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Load WordPress test suite functions
|
||||
require_once $wp_tests_dir . '/includes/functions.php';
|
||||
|
||||
/**
|
||||
* Manually load the plugin for testing
|
||||
*/
|
||||
function _manually_load_plugin() {
|
||||
global $plugin_dir;
|
||||
require $plugin_dir . '/care-booking-block.php';
|
||||
|
||||
// Ensure KiviCare plugin functions are available for testing
|
||||
if (!function_exists('is_kivicare_active')) {
|
||||
function is_kivicare_active() {
|
||||
return true; // Mock KiviCare as active for tests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load plugin before WordPress starts
|
||||
tests_add_filter('muplugins_loaded', '_manually_load_plugin');
|
||||
|
||||
// Start up the WordPress testing environment
|
||||
require $wp_tests_dir . '/includes/bootstrap.php';
|
||||
|
||||
// Load plugin test utilities
|
||||
require_once $plugin_dir . '/tests/test-utilities.php';
|
||||
Reference in New Issue
Block a user