You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
640 B
21 lines
640 B
|
1 day ago
|
<?php
|
||
|
|
|
||
|
|
namespace Tests\Unit;
|
||
|
|
|
||
|
|
use App\Services\Crawl\CrawlKeywordParser;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
|
||
|
|
class CrawlKeywordParserTest extends TestCase
|
||
|
|
{
|
||
|
|
public function test_build_arxiv_search_query_without_keyword_uses_category_wildcard(): void
|
||
|
|
{
|
||
|
|
$this->assertSame('cat:*', CrawlKeywordParser::buildArxivSearchQuery(''));
|
||
|
|
$this->assertSame('cat:*', CrawlKeywordParser::buildArxivSearchQuery(null));
|
||
|
|
}
|
||
|
|
|
||
|
|
public function test_build_arxiv_search_query_with_phrase(): void
|
||
|
|
{
|
||
|
|
$this->assertSame('(all:machine AND all:learning)', CrawlKeywordParser::buildArxivSearchQuery('machine learning'));
|
||
|
|
}
|
||
|
|
}
|