From dd38f4e0eb878881efc0a626804a949431ee6b4a Mon Sep 17 00:00:00 2001 From: eai04191 Date: Mon, 26 Aug 2019 23:46:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A2=E3=83=95=E3=82=A3=E3=83=AA=E3=82=A8?= =?UTF-8?q?=E3=82=A4=E3=83=88=E5=85=88=E3=81=8C=E4=B8=8D=E6=AD=A3=E3=81=AA?= =?UTF-8?q?URL=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Unit/MetadataResolver/DLsiteResolverTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Unit/MetadataResolver/DLsiteResolverTest.php b/tests/Unit/MetadataResolver/DLsiteResolverTest.php index 8a7142a..b0bf40f 100644 --- a/tests/Unit/MetadataResolver/DLsiteResolverTest.php +++ b/tests/Unit/MetadataResolver/DLsiteResolverTest.php @@ -258,4 +258,14 @@ class DLsiteResolverTest extends TestCase $this->assertSame('https://www.dlsite.com/home/work/=/product_id/RJ221761.html', (string) $this->handler->getLastRequest()->getUri()); } } + + public function testAffiliateBadUrl() + { + $this->createResolver(DLsiteResolver::class, ''); + + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage('アフィリエイト先のリンクがDLsiteのタイトルではありません: https://www.dlsite.com/home/'); + + $this->resolver->resolve('http://www.dlsite.com/home/dlaf/=/aid/eai04191/url/https%3A%2F%2Fwww.dlsite.com%2Fhome%2F'); + } }