- Added tests to ensure Redis namespace safety for `db_object_t` and `users_o`. - Implemented `MotorApiCachedResultTest` to validate metadata caching behavior. - Introduced configuration classes for `xlvask_automatic_order_attachment_enabled` and `xlvask_automatic_order_creation_enabled`. - Developed `xlvask_automation_service` with supporting features for usage log evaluation, suggestion building, and order automation.
23 lines
519 B
PHP
23 lines
519 B
PHP
<?php
|
|
|
|
use classes\motorapi;
|
|
|
|
require_once WD . '/classes/motorapi.php';
|
|
|
|
it('only writes cached MotorAPI metadata when a response object exists', function (): void {
|
|
motorapi::addCachedMetaIfPossible(null);
|
|
|
|
$response = new class {
|
|
public array $meta = [];
|
|
|
|
public function add_meta(string $key, mixed $value): void
|
|
{
|
|
$this->meta[$key] = $value;
|
|
}
|
|
};
|
|
|
|
motorapi::addCachedMetaIfPossible($response);
|
|
|
|
expect($response->meta)->toBe(['cached' => true]);
|
|
});
|