Aargh, missed some files from the commit
This commit is contained in:
parent
53d8f4b77f
commit
80d9bc7d59
6 changed files with 55 additions and 57 deletions
|
@ -8,6 +8,7 @@ use GuzzleHttp\HandlerStack;
|
|||
use GuzzleHttp\Psr7\Response;
|
||||
use App\Services\BookmarkService;
|
||||
use GuzzleHttp\Handler\MockHandler;
|
||||
use App\Exceptions\InternetArchiveException;
|
||||
|
||||
class BookmarksTest extends TestCase
|
||||
{
|
||||
|
@ -32,11 +33,10 @@ class BookmarksTest extends TestCase
|
|||
$this->assertEquals('/web/1234/example.org', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException App\Exceptions\InternetArchiveException
|
||||
*/
|
||||
public function test_archive_link_method_archive_site_error_exception()
|
||||
{
|
||||
$this->expectException(InternetArchiveException::class);
|
||||
|
||||
$mock = new MockHandler([
|
||||
new Response(403),
|
||||
]);
|
||||
|
@ -46,11 +46,10 @@ class BookmarksTest extends TestCase
|
|||
$url = (new BookmarkService())->getArchiveLink('https://example.org');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException App\Exceptions\InternetArchiveException
|
||||
*/
|
||||
public function test_archive_link_method_archive_site_no_location_exception()
|
||||
{
|
||||
$this->expectException(InternetArchiveException::class);
|
||||
|
||||
$mock = new MockHandler([
|
||||
new Response(200),
|
||||
]);
|
||||
|
|
|
@ -14,6 +14,7 @@ use GuzzleHttp\Handler\MockHandler;
|
|||
use Illuminate\FileSystem\FileSystem;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Jonnybarnes\WebmentionsParser\Parser;
|
||||
use App\Exceptions\RemoteContentNotFoundException;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ProcessWebMentionJobTest extends TestCase
|
||||
|
@ -29,11 +30,10 @@ class ProcessWebMentionJobTest extends TestCase
|
|||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \App\Exceptions\RemoteContentNotFoundException
|
||||
*/
|
||||
public function test_for_exception_from_failure_to_get_webmention()
|
||||
{
|
||||
$this->expectException(RemoteContentNotFoundException::class);
|
||||
|
||||
$parser = new Parser();
|
||||
$mock = new MockHandler([
|
||||
new Response(404),
|
||||
|
|
|
@ -66,22 +66,20 @@ class PlacesTest extends TestCase
|
|||
$this->assertEquals(2, count(Place::all())); // still 2 places
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedExceptionMessage Missing required name
|
||||
*/
|
||||
public function test_service_requires_name()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Missing required name');
|
||||
|
||||
$service = new PlaceService();
|
||||
$service->createPlaceFromCheckin(['foo' => 'bar']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedExceptionMessage Missing required longitude/latitude
|
||||
*/
|
||||
public function test_service_requires_latitude()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Missing required longitude/latitude');
|
||||
|
||||
$service = new PlaceService();
|
||||
$service->createPlaceFromCheckin(['properties' => ['name' => 'bar']]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue