Ejemplo n.º 1
0
 public function testCreateWithEmptyFields()
 {
     $fields = [['name' => 'fieldName1', 'type' => 'fieldType1', 'size' => 'fieldSize1'], ['name' => 'fieldName2', 'type' => 'fieldType2', 'size' => 'fieldSize2'], ['name' => 'fieldName3', 'type' => 'fieldType3', 'size' => 'fieldSize3'], ['name' => 'fieldName3', 'dataType' => 'varchar', 'type' => 'text', 'size' => '255'], ['name' => 'fieldName3', 'dataType' => 'mediumtext', 'type' => 'text', 'size' => '16777216'], ['name' => 'fieldName3', 'dataType' => 'text', 'type' => 'text', 'size' => '65536']];
     $index = 'index_name';
     $expectedTable = 'index_name_scope3_scope5_scope1';
     $dimensions = ['index_name_scope_3' => $this->createDimensionMock('scope', 3), 'index_name_scope_5' => $this->createDimensionMock('scope', 5), 'index_name_scope_1' => $this->createDimensionMock('scope', 1)];
     $position = 0;
     $this->indexScopeResolver->expects($this->once())->method('resolve')->with($index, $dimensions)->willReturn($expectedTable);
     $this->flatScopeResolver->expects($this->once())->method('resolve')->with($index, $dimensions)->willReturn($index . '_flat');
     $position = $this->mockFulltextTable($position, $expectedTable, true);
     $this->mockFlatTable($position, $index . '_flat');
     $this->target->create($index, $fields, $dimensions);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function cleanIndex($dimensions)
 {
     $this->indexStructure->delete($this->getIndexName(), $dimensions);
     $this->indexStructure->create($this->getIndexName(), $this->fields, $dimensions);
 }