for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Elastica\Test\Processor;
use Elastica\Processor\DateIndexNameProcessor;
use Elastica\Test\BasePipeline as BasePipelineTest;
/**
* @internal
*/
class DateIndexNameProcessorTest extends BasePipelineTest
{
* @group unit
public function testDateIndexName(): void
$processor = new DateIndexNameProcessor('date1', 'M');
$expected = [
'date_index_name' => [
'field' => 'date1',
'date_rounding' => 'M',
],
];
$this->assertEquals($expected, $processor->toArray());
}
public function testDateIndexNameWithNonDefaultOptions(): void
$processor->setTimezone('Europe/Rome');
$processor->setLocale('ITALIAN');
$processor->setIndexNamePrefix('myindex-');
$processor->setDateFormats(['dd/MM/yyyy hh:mm:ss', 'ISO8601', 'UNIX', 'UNIX_MS']);
'timezone' => 'Europe/Rome',
'locale' => 'ITALIAN',
'date_formats' => ['dd/MM/yyyy hh:mm:ss', 'ISO8601', 'UNIX', 'UNIX_MS'],
'index_name_prefix' => 'myindex-',