for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Firesphere\SolrCompatibility\Tests;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\FullTextSearch\Search\Queries\SearchQuery;
class SearchQueryTest extends SapphireTest
{
public function testAddSearchTerm()
$query = new SearchQuery();
$query = $query->addSearchTerm('Test term', [], 2);
SilverStripe\FullTextSea...hQuery::addSearchTerm()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
$query = /** @scrutinizer ignore-deprecated */ $query->addSearchTerm('Test term', [], 2);
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
$expected = [
[
'text' => 'Test term',
'fields' =>
],
'boost' => 2,
'fuzzy' => null,
]
];
$this->assertEquals($expected, $query->getTerms());
}
public function testLimits()
$query->setLimit(5);
SilverStripe\FullTextSea...SearchQuery::setLimit()
/** @scrutinizer ignore-deprecated */ $query->setLimit(5);
$this->assertEquals(5, $query->getRows());
$this->assertEquals(5, $query->getLimit());
SilverStripe\FullTextSea...SearchQuery::getLimit()
$this->assertEquals(5, /** @scrutinizer ignore-deprecated */ $query->getLimit());
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.