
* Add support for DNS lookup of . (root) * Prefer the POST command over the GET command * Add extra helper method to read flash message and allow for sending commands on a specified URL * Add ClearTest * Add IpTest * Add ManualTest * Add DoomTest
28 lines
697 B
PHP
28 lines
697 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
use Illuminate\Foundation\Testing\TestResponse;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
use CreatesApplication;
|
|
|
|
protected $baseUrl = 'https://dnsrecords.io.dev';
|
|
|
|
protected function sendCommand(string $command, string $url = null): TestResponse
|
|
{
|
|
$url = $url ? $this->baseUrl . $url : "{$this->baseUrl}/{$command}";
|
|
|
|
return $this->post($url, compact('command'));
|
|
}
|
|
|
|
protected function getFlashMessage(): ?string
|
|
{
|
|
$flash = app('session.store')
|
|
->get('flash_notification');
|
|
|
|
return $flash ? $flash->first()->message : null;
|
|
}
|
|
}
|