Skip to content

Commit

Permalink
fixed crawler tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Dec 12, 2017
1 parent 255dc22 commit 7bc5d18
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions modules/crawler/tests/models/IndexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ public function getNgRestPrimaryKey()

class IndexTest extends CrawlerTestCase
{
public $fixture;

public function setUp()
{
parent::setUp();
$this->fixture = new IndexFixture();
$this->fixture->load();
}

public function tearDown()
{
$this->fixture->unload();
}

public function testPreview()
{
$model = new StubIndex();
Expand All @@ -36,9 +50,6 @@ public function testPreview()

public function testFlatSearchByQuery()
{
$fixture = new IndexFixture();
$fixture->load();

$test = Index::flatSearchByQuery('aaa', 'en');
$this->assertSame('aaa', $test[0]->title);

Expand All @@ -54,9 +65,6 @@ public function testFlatSearchByQuery()

public function testsearchByQuery()
{
$fixture = new IndexFixture();
$fixture->load();

$test1 = Index::searchByQuery('aaa', 'en');
$this->assertSame('aaa', $test1[0]->title);
$test1 = Index::searchByQuery('AAA', 'en');
Expand All @@ -71,9 +79,6 @@ public function testsearchByQuery()

public function testEnhancedSearchByQuery()
{
$fixture = new IndexFixture();
$fixture->load();

$test1 = Index::searchByQuery('drink bug', 'en');
$this->assertSame('index2', $test1[0]->title);

Expand All @@ -99,9 +104,6 @@ public function testEnhancedSearchByQuery()

public function testEmptySearchs()
{
$fixture = new IndexFixture();
$fixture->load();

$test1 = Index::searchByQuery('1', 'en');
$this->assertEmpty($test1);
$test2 = Index::flatSearchByQuery('1', 'en');
Expand All @@ -111,7 +113,6 @@ public function testEmptySearchs()
public function testSortByUrl()
{
$test1 = Index::searchByQuery('item', 'en');

$this->assertSame(3, count($test1));

$this->assertSame('index5/item', $test1[0]->url);
Expand Down

0 comments on commit 7bc5d18

Please sign in to comment.