'店铺A'], ['erp_store_name' => '店铺B'], ['erp_store_name' => '店铺C'], ]; $periods = Mockery::mock(StoreReportPeriodBuilder::class)->makePartial(); $periods->shouldReceive('build')->once()->with($stores)->andReturn([ '店铺A' => [ ['company_name' => '旧主体', 'effective_at' => '2026-07-01', 'expires_at' => '2026-09-13'], ['company_name' => '过渡主体', 'effective_at' => '2026-09-14', 'expires_at' => null], ['company_name' => '最新主体', 'effective_at' => '2026-10-01', 'expires_at' => null], ], '店铺B' => [ ['company_name' => '已失效主体', 'effective_at' => '2026-07-01', 'expires_at' => '2026-09-30'], ], '店铺C' => [ ['company_name' => null, 'effective_at' => '2026-07-01', 'expires_at' => null], ], ]); $this->assertSame(['店铺A' => '最新主体'], $periods->currentCompanies($stores)); } }