dnsrecords.io/tests/TestCase.php
Brent Roose 9f487be1b2 Improve tests (#35)
* 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
2017-11-06 19:43:30 +01:00

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;
}
}