feat(settings): enable_automation gate; reject stale montzar quote jumps

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 16:15:52 +03:30
co-authored by Cursor
parent b28a98938e
commit 352bb9976d
9 changed files with 212 additions and 18 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace Tests\Unit;
use App\Services\ConfigService;
use PHPUnit\Framework\TestCase;
class QuotePricePlausibilityTest extends TestCase
{
public function test_rejects_stale_montzar_jump_against_reference(): void
{
$config = new class extends ConfigService {
public function referenceQuotePrice(): float
{
return 223_260_000.0;
}
};
$this->assertFalse($config->isPlausibleQuotePrice(168_336_410.0));
$this->assertTrue($config->isPlausibleQuotePrice(222_010_000.0));
$this->assertTrue($config->isPlausibleQuotePrice(223_260_000.0));
}
public function test_accepts_any_positive_when_no_reference(): void
{
$config = new class extends ConfigService {
public function referenceQuotePrice(): float
{
return 0.0;
}
};
$this->assertTrue($config->isPlausibleQuotePrice(168_336_410.0));
$this->assertFalse($config->isPlausibleQuotePrice(0.0));
}
}