'],
]);
// We need to call these again, since we rolled back the transaction started by `::app()`.
@@ -55,14 +57,14 @@ class ListWithFulltextSearchTest extends TestCase
{
parent::tearDown();
- $this->database()->table('discussions')->whereIn('id', [1, 2, 3])->delete();
- $this->database()->table('posts')->whereIn('id', [1, 2, 3, 4])->delete();
+ $this->database()->table('discussions')->delete();
+ $this->database()->table('posts')->delete();
}
/**
* @test
*/
- public function can_search_for_word_in_post()
+ public function can_search_for_word_or_title_in_post()
{
$response = $this->send(
$this->request('GET', '/api/discussions')
@@ -77,7 +79,7 @@ class ListWithFulltextSearchTest extends TestCase
return $row['id'];
}, $data['data']);
- $this->assertEquals(['2', '3'], $ids, 'IDs do not match');
+ $this->assertEquals(['2', '1', '3'], $ids, 'IDs do not match');
}
/**
@@ -98,7 +100,7 @@ class ListWithFulltextSearchTest extends TestCase
return $row['id'];
}, $data['data']);
- $this->assertEquals(['2', '3'], $ids, 'IDs do not match');
+ $this->assertEquals(['2', '1', '3'], $ids, 'IDs do not match');
}
/**