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:
Emanuel Almeida
2025-09-12 01:27:37 +01:00
parent c19f6fd9ee
commit 8c4f68576f
107 changed files with 1596 additions and 657 deletions

View File

@@ -1,3 +1,8 @@
/**
* Descomplicar® Crescimento Digital
* https://descomplicar.pt
*/
<?php
require_once __DIR__ . '/TestCase.php';
@@ -33,16 +38,44 @@ class IntegrationTest extends \PHPUnit\Framework\TestCase
protected function setUp(): void
{
// Initialize all services
parent::setUp(); // This will call initializeCodeIgniter() from TestCase.php
// Define mock for get_option if it doesn't exist
if (!function_exists('get_option')) {
function get_option($name, $default = '') {
$options = [
'desk_moloni_redis_host' => '127.0.0.1',
'desk_moloni_redis_port' => 6379,
'desk_moloni_redis_password' => '',
'desk_moloni_redis_db' => 1,
'desk_moloni_sync_enabled' => '1',
'desk_moloni_sync_customers' => '1',
'desk_moloni_sync_invoices' => '1',
'desk_moloni_sync_products' => '1',
'desk_moloni_sync_estimates' => '1',
'desk_moloni_sync_payments' => '1',
];
return $options[$name] ?? $default;
}
}
// These services don't have complex dependencies in their constructors yet
$this->entity_mapping = new EntityMappingService();
$this->client_sync = new ClientSyncService();
$this->product_sync = new ProductSyncService();
$this->invoice_sync = new InvoiceSyncService();
$this->estimate_sync = new EstimateSyncService();
$this->queue_processor = new QueueProcessor();
// Instantiate PerfexHooks, which will create the QueueProcessor with all its dependencies
$this->perfex_hooks = new PerfexHooks();
$this->entity_mapping = new EntityMappingService();
// Clear any existing test data
// Get the QueueProcessor instance from the hooks class for test assertions
$reflection = new \ReflectionClass($this->perfex_hooks);
$queue_processor_property = $reflection->getProperty('queue_processor');
$queue_processor_property->setAccessible(true);
$this->queue_processor = $queue_processor_property->getValue($this->perfex_hooks);
// Clean up any existing test data
$this->cleanupTestData();
}