Skip to content

Commit

Permalink
Merge pull request #617 from eai04191/fix-monday-morning
Browse files Browse the repository at this point in the history
実際のhtmlを使うテストでコケてたものを更新
  • Loading branch information
shibafu528 authored Feb 14, 2021
2 parents b013435 + 1d98089 commit d0f110a
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 52 deletions.
10 changes: 5 additions & 5 deletions tests/Unit/MetadataResolver/NijieResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ public function testAnimationGif()

$this->createResolver(NijieResolver::class, $responseText);

$metadata = $this->resolver->resolve('https://nijie.info/view.php?id=9537');
$this->assertSame('ニジエがgifに対応したんだってね 奥さん', $metadata->title);
$this->assertSame('投稿者: 黒末アプコ' . PHP_EOL . 'アニメgifとか専門外なのでよくわかりませんでした', $metadata->description);
$metadata = $this->resolver->resolve('https://nijie.info/view.php?id=393134');
$this->assertSame('MANKALOさん', $metadata->title);
$this->assertStringStartsWith('投稿者: sb' . PHP_EOL . 'すけぶの。服の着脱機能を勝手に付けさせて頂きました。', $metadata->description);
$this->assertStringStartsWith('https://nijie.info/pic/logo/nijie_logo_og.png', $metadata->image);
$this->assertSame(['アニメgif'], $metadata->tags);
$this->assertSame(['ロリ', '中出し', '騎乗位', '獣耳', 'GIFアニメ', 'ドット絵'], $metadata->tags);
if ($this->shouldUseMock()) {
$this->assertSame('https://nijie.info/view.php?id=9537', (string) $this->handler->getLastRequest()->getUri());
$this->assertSame('https://nijie.info/view.php?id=393134', (string) $this->handler->getLastRequest()->getUri());
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/MetadataResolver/PixivResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testIllust()
$this->assertEquals('coffee break', $metadata->title);
$this->assertStringStartsWith('投稿者: 裕', $metadata->description);
$this->assertEquals('https://i.pixiv.cat/img-master/img/2018/04/12/00/01/28/68188073_p0_master1200.jpg', $metadata->image);
$this->assertEquals(['オリジナル', 'カフェ', '眼鏡', 'イヤホン', 'ぱっつん', '艶ぼくろ', '眼鏡っ娘', 'オリジナル5000users入り', 'マニキュア'], $metadata->tags);
$this->assertEquals(['オリジナル', 'カフェ', '眼鏡', 'イヤホン', 'ぱっつん', '艶ぼくろ', '眼鏡っ娘', 'オリジナル5000users入り', 'マニキュア', '赤セーター'], $metadata->tags);
if ($this->shouldUseMock()) {
$this->assertSame('https://www.pixiv.net/ajax/illust/68188073', (string) $this->handler->getLastRequest()->getUri());
}
Expand Down Expand Up @@ -76,7 +76,7 @@ public function testArtworkUrl()
$this->assertEquals('coffee break', $metadata->title);
$this->assertStringStartsWith('投稿者: 裕', $metadata->description);
$this->assertEquals('https://i.pixiv.cat/img-master/img/2018/04/12/00/01/28/68188073_p0_master1200.jpg', $metadata->image);
$this->assertEquals(['オリジナル', 'カフェ', '眼鏡', 'イヤホン', 'ぱっつん', '艶ぼくろ', '眼鏡っ娘', 'オリジナル5000users入り', 'マニキュア'], $metadata->tags);
$this->assertEquals(['オリジナル', 'カフェ', '眼鏡', 'イヤホン', 'ぱっつん', '艶ぼくろ', '眼鏡っ娘', 'オリジナル5000users入り', 'マニキュア', '赤セーター'], $metadata->tags);
if ($this->shouldUseMock()) {
$this->assertSame('https://www.pixiv.net/ajax/illust/68188073', (string) $this->handler->getLastRequest()->getUri());
}
Expand All @@ -92,7 +92,7 @@ public function testArtworkUrlEn()
$this->assertEquals('coffee break', $metadata->title);
$this->assertStringStartsWith('投稿者: 裕', $metadata->description);
$this->assertEquals('https://i.pixiv.cat/img-master/img/2018/04/12/00/01/28/68188073_p0_master1200.jpg', $metadata->image);
$this->assertEquals(['オリジナル', 'カフェ', '眼鏡', 'イヤホン', 'ぱっつん', '艶ぼくろ', '眼鏡っ娘', 'オリジナル5000users入り', 'マニキュア'], $metadata->tags);
$this->assertEquals(['オリジナル', 'カフェ', '眼鏡', 'イヤホン', 'ぱっつん', '艶ぼくろ', '眼鏡っ娘', 'オリジナル5000users入り', 'マニキュア', '赤セーター'], $metadata->tags);
if ($this->shouldUseMock()) {
$this->assertSame('https://www.pixiv.net/ajax/illust/68188073', (string) $this->handler->getLastRequest()->getUri());
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/MetadataResolver/SteamResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function test()
$metadata = $this->resolver->resolve('https://store.steampowered.com/app/333600');
$this->assertEquals('NEKOPARA Vol. 1', $metadata->title);
$this->assertEquals('水無月嘉祥(みなづき かしょう)は伝統ある老舗和菓子屋である実家を出て、 パティシエとして自身のケーキ屋『ラ・ソレイユ』を一人で開店する。 しかし実家から送った引っ越し荷物の中に、 実家で飼っていた人型ネコのショコラとバニラが紛れ込んでいた。', $metadata->description);
$this->assertStringStartsWith('https://steamcdn-a.akamaihd.net/steam/apps/333600/header.jpg?t=', $metadata->image);
$this->assertStringStartsWith('https://cdn.akamai.steamstatic.com/steam/apps/333600/header.jpg?t=', $metadata->image);
}

public function testR18()
Expand All @@ -39,7 +39,7 @@ public function testR18()
$metadata = $this->resolver->resolve('https://store.steampowered.com/app/1077580');
$this->assertEquals('Broke Girl | 負債千金', $metadata->title);
$this->assertEquals('苦労知らずに育ったお嬢様は一夜にして1000万の借金を背負うことになった。借金を返済するために働かなければならない。しかし世間には悪意が満ちており、男達はお金で彼女を誘うか凌辱することしか考えていない。', $metadata->description);
$this->assertStringStartsWith('https://steamcdn-a.akamaihd.net/steam/apps/1077580/header.jpg?t=', $metadata->image);
$this->assertStringStartsWith('https://cdn.akamai.steamstatic.com/steam/apps/1077580/header.jpg?t=', $metadata->image);
}

public function testNotFound()
Expand Down
Loading

0 comments on commit d0f110a

Please sign in to comment.