create([ 'name' => '师资列表页(通用 HTML)', 'target_type' => 'teacher', 'adapter_code' => 'faculty_list_html', 'entry_url' => 'https://', 'match_domains' => ['*'], 'status' => 1, 'sort' => 30, ]); CrawlSource::query()->create([ 'name' => '交大人工智能研究院研究中心', 'target_type' => 'teacher', 'adapter_code' => 'ai_sjtu_research_center_api', 'entry_url' => 'https://ai.sjtu.edu.cn/center', 'match_domains' => ['ai.sjtu.edu.cn'], 'status' => 1, 'sort' => 25, ]); $resolver = new CrawlSourceResolver; $source = $resolver->resolve('https://ai.sjtu.edu.cn/center', 'teacher'); $this->assertNotNull($source); $this->assertSame('ai_sjtu_research_center_api', $source->adapter_code); } }