true, 'upstream_mirrors.table_sync.dedicated_datasets' => [ ProductCatalogMirrorRepository::DATASET_KEY, ], ]); $catalog = Mockery::mock(BusinessMirrorDataset::class); $other = Mockery::mock(BusinessMirrorDataset::class); $datasets = Mockery::mock(BusinessMirrorDatasetRegistry::class); $datasets->shouldReceive('all')->once()->andReturn([ ProductCatalogMirrorRepository::DATASET_KEY => $catalog, 'test.dbo.other' => $other, ]); $mirror = Mockery::mock(GenericBusinessMirrorRepository::class); $mirror->shouldReceive('state')->once()->with($other)->andReturn([ 'initial_completed_at' => '2026-08-01 02:00:00', 'last_attempted_at' => '2026-08-15 01:00:00', ]); $mirror->shouldNotReceive('state')->with($catalog); $synchronizer = Mockery::mock(BusinessMirrorSynchronizer::class); $synchronizer->shouldReceive('sync') ->once() ->with('test.dbo.other', false, null, null) ->andReturn([ 'status' => 'succeeded', 'mode' => 'incremental', 'batches' => 1, 'rows' => 10, 'dataset' => 'test.dbo.other', ]); $this->app->instance(BusinessMirrorDatasetRegistry::class, $datasets); $this->app->instance(GenericBusinessMirrorRepository::class, $mirror); $this->app->instance(BusinessMirrorSynchronizer::class, $synchronizer); $this->artisan('business-mirror:sync-tables')->assertSuccessful(); } }