public function testNameParse() { list($name, $aka) = CrawlDmmTask::parseNameAndAka('中野美奈'); $this->assertEquals('中野美奈', $name); $this->assertEquals([], $aka); list($name, $aka) = CrawlDmmTask::parseNameAndAka('酒井ちなみ(紫葵)'); $this->assertEquals('酒井ちなみ', $name); $this->assertEquals(['紫葵'], $aka); list($name, $aka) = CrawlDmmTask::parseNameAndAka('黒木麻衣(花野真衣、SHIHO)'); $this->assertEquals('黒木麻衣', $name); $this->assertEquals(['花野真衣', 'SHIHO'], $aka); }
public function testAction() { $task = new CrawlDmmTask(); $response = $task->dmmApiCall(['page' => 1, 'perPage' => 1]); return $this->response->setJsonContent(simplexml_load_string($response->getBody())); }
private function processDirector($casts) { /** @var Staffs $cast */ foreach ($casts as $key => $cast) { $cast->id = CrawlDmmTask::dmmDirectorIDConvert($cast->id); $cast->isDirector = 1; $casts[$key] = $cast; } return $casts; }