OGPResolverTestをrevert、Guzzleの例外を期待するように変更
This commit is contained in:
parent
ccade6ff9f
commit
2c4eaccf43
@ -3,12 +3,21 @@
|
|||||||
namespace Tests\Unit\MetadataResolver;
|
namespace Tests\Unit\MetadataResolver;
|
||||||
|
|
||||||
use App\MetadataResolver\OGPResolver;
|
use App\MetadataResolver\OGPResolver;
|
||||||
|
use GuzzleHttp\Exception\BadResponseException;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class OGPResolverTest extends TestCase
|
class OGPResolverTest extends TestCase
|
||||||
{
|
{
|
||||||
use CreateMockedResolver;
|
use CreateMockedResolver;
|
||||||
|
|
||||||
|
public function testMissingUrl()
|
||||||
|
{
|
||||||
|
$this->createResolver(OGPResolver::class, '', [], 404);
|
||||||
|
|
||||||
|
$this->expectException(BadResponseException::class);
|
||||||
|
$this->resolver->resolve('http://example.com/404');
|
||||||
|
}
|
||||||
|
|
||||||
public function testResolve()
|
public function testResolve()
|
||||||
{
|
{
|
||||||
$response = <<< 'HTML'
|
$response = <<< 'HTML'
|
||||||
|
Loading…
Reference in New Issue
Block a user