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
|
@ -6,6 +6,7 @@ use Tests\TestCase;
|
|||
use Lcobucci\JWT\Builder;
|
||||
use App\Services\TokenService;
|
||||
use Lcobucci\JWT\Signer\Hmac\Sha256;
|
||||
use App\Exceptions\InvalidTokenException;
|
||||
|
||||
class TokenServiceTest extends TestCase
|
||||
{
|
||||
|
@ -33,12 +34,11 @@ class TokenServiceTest extends TestCase
|
|||
$this->assertSame($data, $validData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException App\Exceptions\InvalidTokenException
|
||||
* @expectedExceptionMessage Token failed validation
|
||||
*/
|
||||
public function test_token_with_different_singing_key_throws_exception()
|
||||
public function test_token_with_different_signing_key_throws_exception()
|
||||
{
|
||||
$this->expectException(InvalidTokenException::class);
|
||||
$this->expectExceptionMessage('Token failed validation');
|
||||
|
||||
$data = [
|
||||
'me' => 'https://example.org',
|
||||
'client_id' => 'https://quill.p3k.io',
|
||||
|
|
|
@ -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