/** * Make sure detailsAboutNumberOfClients works as expected when both campaigns have same number of clients. */ public function test_details_about_number_of_clients_when_both_campaigns_have_same_number_of_clients() { $clients = factory(\App\Client::class, 4)->create(['user_id' => $this->user->id]); foreach ($clients as $client) { factory(\App\Bill::class)->create(['client_id' => $client->id, 'user_id' => $this->user->id, 'campaign_id' => \App\Campaign::where('number', $this->firstCampaign['number'])->where('year', $this->firstCampaign['year'])->first()->id]); factory(\App\Bill::class)->create(['client_id' => $client->id, 'user_id' => $this->user->id, 'campaign_id' => \App\Campaign::where('number', $this->secondCampaign['number'])->where('year', $this->secondCampaign['year'])->first()->id]); } $this->translationData['clients'] = 4; $expected = ['message' => trans('statistics.details_about_number_of_clients_equal_trend', $this->translationData), 'title' => trans('statistics.details_about_number_of_clients_equal_trend_title'), 'number_of_clients' => 4, 'number_of_clients_in_campaign_to_compare' => 4]; $expected = array_merge($expected, $this->baseExpected); $this->actingAs($this->user)->assertEquals($expected, \App\Helpers\Statistics\CompareCampaignsStatistics::detailsAboutNumberOfClients($this->firstCampaign, $this->secondCampaign)); }