Ejemplo n.º 1
0
 /**
  * @return void
  */
 public function testGenerateComplexIndexMap()
 {
     $generator = new IndexMapGenerator(self::TARGET_DIRECTORY);
     $indexDefinition = $this->createIndexDefinition('index-1', [], ['complex' => ['properties' => ['foo' => ['a' => 'asdf', 'b' => 'qwer', 'properties' => ['bar' => ['a' => 'asdf', 'b' => 'qwer', 'properties' => ['baz' => ['a' => 'asdf', 'b' => 'qwer']]]]]]]]);
     $generator->generate($indexDefinition);
     $this->assertFileEquals(self::FIXTURES_DIRECTORY . 'ComplexIndexMap.expected.php', self::TARGET_DIRECTORY . 'ComplexIndexMap.php');
 }
Ejemplo n.º 2
0
 /**
  * @return void
  */
 public function install()
 {
     $this->indexMapCleaner->cleanDirectory();
     $indexDefinitions = $this->indexDefinitionLoader->loadIndexDefinitions();
     foreach ($indexDefinitions as $indexDefinition) {
         $this->messenger->info(sprintf('Generating index map classes for index: "%s"', $indexDefinition->getIndexName()));
         $this->indexMapGenerator->generate($indexDefinition);
     }
 }