loginAs() ->get(route('notifications.index')) ->assertStatus(200) ->assertSeeText(trans_choice('general.items', 2)); } public function testItShouldSeeReadAllAction() { $this->loginAs() ->get(route('notifications.read-all')) ->assertStatus(302); $this->assertFlashLevel('success'); } public function testItShouldSeeDisableAction() { $this->loginAs() ->post(route('notifications.disable'), ['path' => 'double-entry', 'id' => 1]) ->assertOk() ->assertSeeText(trans('messages.success.disabled', [ 'type' => Str::lower(trans_choice('general.notifications', 2)) ])); } public function testItShouldSeeNewApps() { $notificatinos = $this->getNewApps(); $this->loginAs() ->get(route('notifications.index')) ->assertOk() ->assertSeeText('Double-Entry'); } protected function getNewApps() { $new_apps[] = (object) [ "name" => "Double-Entry", "alias" => "double-entry", "message" => "Double-Entry<\/a> app is published. You can check it out!", "path" =>"new-apps", "started_at" => "2021-06-26 00:00:00", "ended_at" => "2021-07-11 00:00:00", "status" => 2, ]; $key = 'apps.notifications'; Cache::put($key, ['new-apps' => $new_apps], Date::now()->addHour(6)); } }