mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 13:23:04 +01:00
Used a mock ooklatester in tests
Speed up test suite
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Interfaces\SpeedtestProvider;
|
||||
use App\Models\Speedtest;
|
||||
use App\Utils\OoklaTester;
|
||||
use Carbon\Carbon;
|
||||
@@ -25,7 +26,7 @@ class SpeedtestHelper
|
||||
*/
|
||||
public static function runSpeedtest()
|
||||
{
|
||||
$tester = new OoklaTester();
|
||||
$tester = app()->make(SpeedtestProvider::class);
|
||||
return $tester->run();
|
||||
}
|
||||
|
||||
|
||||
37
app/Utils/InfluxDB/InfluxDBVersion2Wrapper.php
Normal file
37
app/Utils/InfluxDB/InfluxDBVersion2Wrapper.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Utils\InfluxDB;
|
||||
|
||||
use App\Interfaces\InfluxDBWrapperInterface;
|
||||
use App\Models\Speedtest;
|
||||
use InfluxDB2\Client;
|
||||
|
||||
class InfluxDBVersion2Wrapper implements InfluxDBWrapperInterface
|
||||
{
|
||||
private Client $client;
|
||||
|
||||
public function __construct(Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
public function testConnection(): bool
|
||||
{
|
||||
return $this->client->health()->getStatus() !== 'pass';
|
||||
}
|
||||
|
||||
public function doesDatabaseExist(string $database): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function createDatabase(string $database): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function store(Speedtest $speedtest): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user