mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\SearchEngine;
|
|
|
|
use Alchemy\Phrasea\SearchEngine\SphinxSearch\SphinxSearchEngine;
|
|
use Alchemy\Phrasea\SearchEngine\SphinxSearch\ConfigurationPanel;
|
|
use Alchemy\Tests\Phrasea\SearchEngine\ConfigurationPanelAbstractTest;
|
|
|
|
class SphinxSearchConfigurationPanelTest extends ConfigurationPanelAbstractTest
|
|
{
|
|
/**
|
|
* @covers Alchemy\Phrasea\SearchEngine\SphinxSearch\ConfigurationPanel
|
|
*/
|
|
public static function setUpBeforeClass()
|
|
{
|
|
parent::setUpBeforeClass();
|
|
}
|
|
|
|
public function getPanel()
|
|
{
|
|
return new ConfigurationPanel(new SphinxSearchEngine(self::$DI['app'], 'localhost', 9306, 'localhost', 9308));
|
|
}
|
|
|
|
public function testGetAVailableCharsets()
|
|
{
|
|
$charsets = $this->getPanel()->getAvailableCharsets();
|
|
|
|
$this->assertInternalType('array', $charsets);
|
|
foreach ($charsets as $name => $charset) {
|
|
$this->assertInternalType('string', $name);
|
|
$this->assertInstanceOf('Alchemy\Phrasea\SearchEngine\SphinxSearch\AbstractCharset', $charset);
|
|
}
|
|
}
|
|
|
|
public function testGenerateSphinxConf()
|
|
{
|
|
$databoxes = self::$DI['app']['phraseanet.appbox']->get_databoxes();
|
|
$configuration = $this->getPanel()->getConfiguration();
|
|
|
|
$conf = $this->getPanel()->generateSphinxConf($databoxes, $configuration);
|
|
$this->assertInternalType('string', $conf);
|
|
}
|
|
|
|
} |