すべてwixmpを使用するようになったので分ける必要がなくなった
ついでに$data['thumbnail_url']なら常にオプションが付いているのでオプションを含んでいるか判別する必要がなくなった
This commit is contained in:
@@ -18,36 +18,6 @@ class DeviantArtResolverTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testWixmp()
|
||||
{
|
||||
$responseText = file_get_contents(__DIR__ . '/../../fixture/DeviantArt/wixmp.json');
|
||||
|
||||
$this->createResolver(DeviantArtResolver::class, $responseText);
|
||||
|
||||
$metadata = $this->resolver->resolve('https://www.deviantart.com/bonchilo/art/Sally-Nox-743562408');
|
||||
$this->assertSame('Sally Nox', $metadata->title);
|
||||
$this->assertSame('By Bonchilo', $metadata->description);
|
||||
$this->assertStringStartsWith('https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/f6b84a8f-053e-4ab6-bd6c-71276a4a9282/dcap4fc-6fd6359c-770b-4515-9e29-e99311d58d57.png/v1/fit/w_1024,h_1024,strp/image.jpg?token=', $metadata->image);
|
||||
if ($this->shouldUseMock()) {
|
||||
$this->assertSame('https://backend.deviantart.com/oembed?url=https://www.deviantart.com/bonchilo/art/Sally-Nox-743562408', (string) $this->handler->getLastRequest()->getUri());
|
||||
}
|
||||
}
|
||||
|
||||
public function testWixmpNoImageOptions()
|
||||
{
|
||||
$responseText = file_get_contents(__DIR__ . '/../../fixture/DeviantArt/wixmpNoImageOptions.json');
|
||||
|
||||
$this->createResolver(DeviantArtResolver::class, $responseText);
|
||||
|
||||
$metadata = $this->resolver->resolve('https://www.deviantart.com/messenger-lame/art/rem-639676105');
|
||||
$this->assertSame('rem', $metadata->title);
|
||||
$this->assertSame('By messenger-lame', $metadata->description);
|
||||
$this->assertStringStartsWith('https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/9afa7937-381f-47f0-a8bc-40b9db1faad1/dakuh8p-aea3fc1c-c06e-466b-88ba-d27be8e164e9.png/v1/fit/w_1024,h_1024,strp/image.jpg?token=', $metadata->image);
|
||||
if ($this->shouldUseMock()) {
|
||||
$this->assertSame('https://backend.deviantart.com/oembed?url=https://www.deviantart.com/messenger-lame/art/rem-639676105', (string) $this->handler->getLastRequest()->getUri());
|
||||
}
|
||||
}
|
||||
|
||||
public function testMature()
|
||||
{
|
||||
$responseText = file_get_contents(__DIR__ . '/../../fixture/DeviantArt/mature.json');
|
||||
@@ -57,7 +27,7 @@ class DeviantArtResolverTest extends TestCase
|
||||
$metadata = $this->resolver->resolve('https://www.deviantart.com/rasbii/art/backstage-620617246');
|
||||
$this->assertSame('backstage', $metadata->title);
|
||||
$this->assertSame('By Rasbii', $metadata->description);
|
||||
$this->assertSame('https://orig00.deviantart.net/eb50/f/2016/191/a/b/preview_by_rasbii-da9hzby.png', $metadata->image);
|
||||
$this->assertStringStartsWith('https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/bee96c7a-4956-44a4-81aa-7587cf0b85d1/da9hzby-b9640ac3-1815-4c77-9410-0d4882a20e25.png/v1/fit/w_1024,h_1024,strp/image.jpg?token=', $metadata->image);
|
||||
if ($this->shouldUseMock()) {
|
||||
$this->assertSame('https://backend.deviantart.com/oembed?url=https://www.deviantart.com/rasbii/art/backstage-620617246', (string) $this->handler->getLastRequest()->getUri());
|
||||
}
|
||||
|
Reference in New Issue
Block a user