Code Duplication    Length = 19-19 lines in 2 locations

Tests/Command/CreateCommandTest.php 2 locations

@@ 82-100 (lines=19) @@
79
        );
80
    }
81
82
    public function testExecuteWithIndexProvidedAndWithAlias()
83
    {
84
        $input = $this->createMock(InputInterface::class);
85
        $output = $this->createMock(OutputInterface::class);
86
87
        $indexName = 'foo';
88
        $mapping = ['mapping'];
89
90
        $input->expects($this->once())->method('getOption')->with('index')->willReturn($indexName);
91
        $output->expects($this->once())->method('writeln');
92
        $this->configManager->expects($this->once())->method('getIndexConfiguration')->with($indexName)->willReturn($this->indexConfig);
93
        $this->indexManager->expects($this->once())->method('getIndex')->with($indexName)->willReturn($this->index);
94
        $this->indexConfig->expects($this->once())->method('isUseAlias')->willReturn(true);
95
        $this->aliasProcessor->expects($this->once())->method('setRootName')->with($this->indexConfig, $this->index);
96
        $this->mappingBuilder->expects($this->once())->method('buildIndexMapping')->with($this->indexConfig)->willReturn($mapping);
97
        $this->index->expects($this->once())->method('create')->with(['mapping'], false);
98
99
        $this->command->run($input, $output);
100
    }
101
102
    public function testExecuteWithIndexProvidedAndWithoutAlias()
103
    {
@@ 102-120 (lines=19) @@
99
        $this->command->run($input, $output);
100
    }
101
102
    public function testExecuteWithIndexProvidedAndWithoutAlias()
103
    {
104
        $input = $this->createMock(InputInterface::class);
105
        $output = $this->createMock(OutputInterface::class);
106
107
        $indexName = 'foo';
108
        $mapping = ['mapping'];
109
110
        $input->expects($this->once())->method('getOption')->with('index')->willReturn($indexName);
111
        $output->expects($this->once())->method('writeln');
112
        $this->configManager->expects($this->once())->method('getIndexConfiguration')->with($indexName)->willReturn($this->indexConfig);
113
        $this->indexManager->expects($this->once())->method('getIndex')->with($indexName)->willReturn($this->index);
114
        $this->indexConfig->expects($this->once())->method('isUseAlias')->willReturn(false);
115
        $this->aliasProcessor->expects($this->never())->method('setRootName');
116
        $this->mappingBuilder->expects($this->once())->method('buildIndexMapping')->with($this->indexConfig)->willReturn($mapping);
117
        $this->index->expects($this->once())->method('create')->with(['mapping'], false);
118
119
        $this->command->run($input, $output);
120
    }
121
122
    public function testExecuteAllIndices()
123
    {