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:
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Descomplicar® Crescimento Digital
|
||||
* https://descomplicar.pt
|
||||
*/
|
||||
|
||||
<?php
|
||||
|
||||
require_once __DIR__ . '/TestCase.php';
|
||||
@@ -22,48 +27,33 @@ class QueueProcessorTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private $queue_processor;
|
||||
private $redis_mock;
|
||||
private $model_mock;
|
||||
private $entity_mapping_mock;
|
||||
private $error_handler_mock;
|
||||
private $retry_handler_mock;
|
||||
private $CI_mock;
|
||||
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
// Create mocks for dependencies
|
||||
$this->redis_mock = $this->createMock(Redis::class);
|
||||
$this->redis_mock = $this->createMock(\Redis::class);
|
||||
$this->model_mock = $this->createMock(Desk_moloni_model::class);
|
||||
$this->entity_mapping_mock = $this->createMock(EntityMappingService::class);
|
||||
$this->error_handler_mock = $this->createMock(ErrorHandler::class);
|
||||
$this->retry_handler_mock = $this->createMock(RetryHandler::class);
|
||||
|
||||
|
||||
// Mock CodeIgniter instance
|
||||
$this->CI_mock = $this->createMock(stdClass::class);
|
||||
$this->CI_mock->desk_moloni_model = $this->createMock(stdClass::class);
|
||||
|
||||
// Initialize service
|
||||
$this->queue_processor = new QueueProcessor();
|
||||
|
||||
// Use reflection to inject mocks
|
||||
$reflection = new ReflectionClass($this->queue_processor);
|
||||
|
||||
$redis_property = $reflection->getProperty('redis');
|
||||
$redis_property->setAccessible(true);
|
||||
$redis_property->setValue($this->queue_processor, $this->redis_mock);
|
||||
|
||||
$entity_mapping_property = $reflection->getProperty('entity_mapping');
|
||||
$entity_mapping_property->setAccessible(true);
|
||||
$entity_mapping_property->setValue($this->queue_processor, $this->entity_mapping_mock);
|
||||
|
||||
$error_handler_property = $reflection->getProperty('error_handler');
|
||||
$error_handler_property->setAccessible(true);
|
||||
$error_handler_property->setValue($this->queue_processor, $this->error_handler_mock);
|
||||
|
||||
$retry_handler_property = $reflection->getProperty('retry_handler');
|
||||
$retry_handler_property->setAccessible(true);
|
||||
$retry_handler_property->setValue($this->queue_processor, $this->retry_handler_mock);
|
||||
|
||||
$ci_property = $reflection->getProperty('CI');
|
||||
$ci_property->setAccessible(true);
|
||||
$ci_property->setValue($this->queue_processor, $this->CI_mock);
|
||||
$this->CI_mock->desk_moloni_model = $this->model_mock;
|
||||
|
||||
// Initialize service with DI
|
||||
$this->queue_processor = new QueueProcessor(
|
||||
$this->redis_mock,
|
||||
$this->model_mock,
|
||||
$this->entity_mapping_mock,
|
||||
$this->error_handler_mock,
|
||||
$this->retry_handler_mock
|
||||
);
|
||||
}
|
||||
|
||||
public function testAddToQueueSuccess()
|
||||
|
||||
Reference in New Issue
Block a user