From 8ff87c2e7a21108b74a0e3aa32581415a2d7a300 Mon Sep 17 00:00:00 2001 From: Henry Whitaker Date: Fri, 11 Sep 2020 01:02:24 +0100 Subject: [PATCH] Updated tests --- README.md | 2 +- changelog.json | 14 ++++++++++++++ config/speedtest.php | 2 +- tests/Feature/APISpeedtestTest.php | 15 ++++++++++----- .../SpeedtestController/LatestTest.php | 5 +++-- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c38a8ec5..ccd742fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Speedtest Tracker -[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker?style=flat-square)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Stable?label=master&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Dev?label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.9.6-success?style=flat-square) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE) +[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker?style=flat-square)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Stable?label=master&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/henrywhitaker3/Speedtest-Tracker/Dev?label=dev&logo=github&style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/actions) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.9.7-success?style=flat-square) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker?style=flat-square)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE) This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [Ookla's speedtest cli](https://www.speedtest.net/apps/cli) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results. diff --git a/changelog.json b/changelog.json index bb9dcfa9..2227b9da 100644 --- a/changelog.json +++ b/changelog.json @@ -1,4 +1,18 @@ { + "1.9.7": [ + { + "description": "Added option to display minimum values on the top widgets.", + "link": "" + }, + { + "description": "New general settings section.", + "link": "" + }, + { + "description": "Updated dependencies.", + "link": "" + } + ], "1.9.6": [ { "description": "Clear the cache on restore.", diff --git a/config/speedtest.php b/config/speedtest.php index 8a160fc1..6b75e412 100644 --- a/config/speedtest.php +++ b/config/speedtest.php @@ -7,7 +7,7 @@ return [ |-------------------------------------------------------------------------- */ - 'version' => '1.9.6', + 'version' => '1.9.7', /* |-------------------------------------------------------------------------- diff --git a/tests/Feature/APISpeedtestTest.php b/tests/Feature/APISpeedtestTest.php index a1e34432..401a6aef 100644 --- a/tests/Feature/APISpeedtestTest.php +++ b/tests/Feature/APISpeedtestTest.php @@ -27,13 +27,13 @@ class APISpeedtestTest extends TestCase $dl = []; $ul = []; - for($i = 0; $i < 3; $i++) { + for ($i = 0; $i < 3; $i++) { $pingVal = $faker->randomFloat(); - array_push($ping,$pingVal); + array_push($ping, $pingVal); $dlVal = $faker->randomFloat(); - array_push($dl,$dlVal); + array_push($dl, $dlVal); $ulVal = $faker->randomFloat(); - array_push($ul,$ulVal); + array_push($ul, $ulVal); Speedtest::create([ 'ping' => $pingVal, @@ -70,7 +70,12 @@ class APISpeedtestTest extends TestCase 'download', 'upload', ], - 'max' => [ + 'maximum' => [ + 'ping', + 'download', + 'upload', + ], + 'minimum' => [ 'ping', 'download', 'upload', diff --git a/tests/Unit/Controllers/SpeedtestController/LatestTest.php b/tests/Unit/Controllers/SpeedtestController/LatestTest.php index 0b6189c3..af7209cd 100644 --- a/tests/Unit/Controllers/SpeedtestController/LatestTest.php +++ b/tests/Unit/Controllers/SpeedtestController/LatestTest.php @@ -19,7 +19,7 @@ class LatestTest extends TestCase */ private $controller; - public function setUp() : void + public function setUp(): void { parent::setUp(); @@ -53,6 +53,7 @@ class LatestTest extends TestCase $this->assertArrayHasKey('data', $resp); $this->assertArrayHasKey('average', $resp); - $this->assertArrayHasKey('max', $resp); + $this->assertArrayHasKey('maximum', $resp); + $this->assertArrayHasKey('minimum', $resp); } }