From: Auto-Claude Orchestrator Date: Tue, 24 Mar 2026 07:22:01 +0000 (+0000) Subject: feat(task-JIRA-ERP-33-20260324070448): Сбор данных по остаткам на день X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=94fc10746590c16ef872e7d3b9d4a09a4e5e8d18;p=erp24_rep%2Fyii-erp24%2F.git feat(task-JIRA-ERP-33-20260324070448): Сбор данных по остаткам на день --- 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'],