From 94fc10746590c16ef872e7d3b9d4a09a4e5e8d18 Mon Sep 17 00:00:00 2001 From: Auto-Claude Orchestrator Date: Tue, 24 Mar 2026 07:22:01 +0000 Subject: [PATCH] =?utf8?q?feat(task-JIRA-ERP-33-20260324070448):=20=D0=A1?= =?utf8?q?=D0=B1=D0=BE=D1=80=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?utf8?q?=D0=BF=D0=BE=20=D0=BE=D1=81=D1=82=D0=B0=D1=82=D0=BA=D0=B0=D0=BC?= =?utf8?q?=20=D0=BD=D0=B0=20=D0=B4=D0=B5=D0=BD=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../unit/services/StockHistoryServiceTest.php | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/erp24/tests/unit/services/StockHistoryServiceTest.php b/erp24/tests/unit/services/StockHistoryServiceTest.php index 2ffdfaf3..6ea0485c 100644 --- a/erp24/tests/unit/services/StockHistoryServiceTest.php +++ b/erp24/tests/unit/services/StockHistoryServiceTest.php @@ -120,7 +120,12 @@ class StockHistoryServiceTest extends Unit public function testCollect_OnConflictUpdate_UsesUpsertQuery(): void { - [$db, $command] = $this->createMockDbAndCommand(); + $db = $this->createMock(\yii\db\Connection::class); + $command = $this->createMock(\yii\db\Command::class); + + $db->method('createCommand')->willReturn($command); + $command->method('bindValues')->willReturnSelf(); + $command->method('bindValue')->willReturnSelf(); $command->method('queryScalar') ->willReturnOnConsecutiveCalls(true, 1, 1, 1, 0, 0, 0, 1, true); @@ -234,7 +239,10 @@ class StockHistoryServiceTest extends Unit public function testCreatePartition_CreatesPartitionTable(): void { - [$db, $command] = $this->createMockDbAndCommand(); + $db = $this->createMock(\yii\db\Connection::class); + $command = $this->createMock(\yii\db\Command::class); + + $db->method('createCommand')->willReturn($command); $executedSql = []; $boundParams = []; @@ -274,7 +282,10 @@ class StockHistoryServiceTest extends Unit public function testEnsurePartitions_CreatesCurrentAndNextMonth(): void { - [$db, $command] = $this->createMockDbAndCommand(); + $db = $this->createMock(\yii\db\Connection::class); + $command = $this->createMock(\yii\db\Command::class); + + $db->method('createCommand')->willReturn($command); $executedSql = []; $command->method('setSql')->willReturnCallback( @@ -295,7 +306,12 @@ class StockHistoryServiceTest extends Unit public function testDropOldPartitions_DropsPartitionsOlderThanRetention(): void { - [$db, $command] = $this->createMockDbAndCommand(); + $db = $this->createMock(\yii\db\Connection::class); + $command = $this->createMock(\yii\db\Command::class); + + $db->method('createCommand')->willReturn($command); + $command->method('bindValues')->willReturnSelf(); + $command->method('bindValue')->willReturnSelf(); $command->method('queryAll')->willReturn([ ['tablename' => 'stock_history_2023_11'], -- 2.39.5