mirror of
https://github.com/Codappix/search_core.git
synced 2024-12-22 19:16:11 +01:00
CLENAUP: Remove some scrutinizer ci issues
This commit is contained in:
parent
62ce197406
commit
1692a02c55
5 changed files with 18 additions and 13 deletions
|
@ -84,8 +84,8 @@ class Elasticsearch implements Singleton, ConnectionInterface
|
|||
{
|
||||
$this->withType(
|
||||
$documentType,
|
||||
function ($type) use($document) {
|
||||
$type->addDocument($this->documentFactory->getDocument($documentType, $document));
|
||||
function ($type) use ($document) {
|
||||
$type->addDocument($this->documentFactory->getDocument($type->getName(), $document));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ class Elasticsearch implements Singleton, ConnectionInterface
|
|||
{
|
||||
$this->withType(
|
||||
$documentType,
|
||||
function ($type) use($documentType) {
|
||||
$type->updateDocument($this->documentFactory->getDocument($documentType, $document));
|
||||
function ($type) use ($document) {
|
||||
$type->updateDocument($this->documentFactory->getDocument($type->getName(), $document));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -120,8 +120,8 @@ class Elasticsearch implements Singleton, ConnectionInterface
|
|||
{
|
||||
$this->withType(
|
||||
$documentType,
|
||||
function ($type) use($documents) {
|
||||
$type->addDocuments($this->documentFactory->getDocuments($documentType, $documents));
|
||||
function ($type) use ($documents) {
|
||||
$type->addDocuments($this->documentFactory->getDocuments($type->getName(), $documents));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class Elasticsearch implements Singleton, ConnectionInterface
|
|||
|
||||
/**
|
||||
* @param SearchRequestInterface $searchRequest
|
||||
* @return SearchResultInterface
|
||||
* @return \Elastica\ResultSet
|
||||
*/
|
||||
public function search(SearchRequestInterface $searchRequest)
|
||||
{
|
||||
|
@ -151,6 +151,7 @@ class Elasticsearch implements Singleton, ConnectionInterface
|
|||
$search->addIndex('typo3content');
|
||||
|
||||
// TODO: Return wrapped result to implement our interface.
|
||||
// Also update php doc to reflect the change.
|
||||
return $search->search($searchRequest->getSearchTerm());
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ class DataHandler implements Singleton
|
|||
}
|
||||
|
||||
$this->dataHandler->delete($table, $uid);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -123,6 +124,7 @@ class DataHandler implements Singleton
|
|||
'Database update not processed, cause status is unhandled.',
|
||||
[$status, $table, $uid, $fieldArray]
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -153,7 +155,7 @@ class DataHandler implements Singleton
|
|||
*
|
||||
* @param string $table
|
||||
* @param int $uid
|
||||
* @return null|array
|
||||
* @return null|array<String>
|
||||
*/
|
||||
protected function getRecord($table, $uid)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ use TYPO3\CMS\Core\Tests\FunctionalTestCase as CoreTestCase;
|
|||
*
|
||||
* It will take care of leaving a clean environment for next test.
|
||||
*/
|
||||
abstract class FunctionalTestCase extends CoreTestCase
|
||||
abstract class AbstractFunctionalTestCase extends CoreTestCase
|
||||
{
|
||||
protected $testExtensionsToLoad = ['typo3conf/ext/search_core'];
|
||||
|
||||
|
@ -54,7 +54,9 @@ abstract class FunctionalTestCase extends CoreTestCase
|
|||
public function tearDown()
|
||||
{
|
||||
// Delete everything so next test starts clean.
|
||||
if ($this->client) {
|
||||
$this->client->getIndex('_all')->delete();
|
||||
$this->client->getIndex('_all')->clearCache();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,14 +21,14 @@ namespace Leonmrni\SearchCore\Tests\Functional\Hooks;
|
|||
*/
|
||||
|
||||
use Leonmrni\SearchCore\Hook\DataHandler as Hook;
|
||||
use Leonmrni\SearchCore\Tests\Functional\FunctionalTestCase;
|
||||
use Leonmrni\SearchCore\Tests\Functional\AbstractFunctionalTestCase;
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DataHandlerTest extends FunctionalTestCase
|
||||
class DataHandlerTest extends AbstractFunctionalTestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
|
|
@ -21,13 +21,13 @@ namespace Leonmrni\SearchCore\Tests\Functional\Indexing;
|
|||
*/
|
||||
|
||||
use Leonmrni\SearchCore\Domain\Index\IndexerFactory;
|
||||
use Leonmrni\SearchCore\Tests\Functional\FunctionalTestCase;
|
||||
use Leonmrni\SearchCore\Tests\Functional\AbstractFunctionalTestCase;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IndexTcaTableTest extends FunctionalTestCase
|
||||
class IndexTcaTableTest extends AbstractFunctionalTestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue