Code Duplication    Length = 13-13 lines in 3 locations

tests/Unit/StarterTest.php 3 locations

@@ 100-112 (lines=13) @@
97
        $this->starter->start();
98
    }
99
100
    public function testStarterStartsWithXvfb()
101
    {
102
        $jarLocation = __DIR__.'/../fixtures/selenium-dummy.jar';
103
        $javaLocation = 'java-location';
104
        $this->exeFinder->expects($this->at(0))->method('find')->with('java')->willReturn($javaLocation);
105
        $this->seleniumOptions->expects($this->any())->method('getSeleniumQuery')->willReturn('not_empty');
106
        $this->seleniumOptions->expects($this->any())->method('getSeleniumUrl')->willReturn('not_empty');
107
        $this->seleniumOptions->expects($this->any())->method('getSeleniumJarLocation')->willReturn($jarLocation);
108
        $this->seleniumOptions->expects($this->any())->method('isXvfbEnabled')->willReturn(true);
109
        $exceptedCmd = 'DISPLAY=:21 '.$javaLocation.' -jar '.$jarLocation;
110
        $this->process->expects($this->any())->method('setCommandLine')->with($exceptedCmd);
111
        $this->starter->start();
112
    }
113
114
    public function testStarterStartsWithPortByExtraArgs()
115
    {
@@ 114-126 (lines=13) @@
111
        $this->starter->start();
112
    }
113
114
    public function testStarterStartsWithPortByExtraArgs()
115
    {
116
        $jarLocation = __DIR__.'/../fixtures/selenium-dummy.jar';
117
        $javaLocation = 'java-location';
118
        $port = 1234;
119
        $this->exeFinder->expects($this->any())->method('find')->with('java')->willReturn($javaLocation);
120
        $this->seleniumOptions->expects($this->any())->method('getSeleniumQuery')->willReturn('not_empty');
121
        $this->seleniumOptions->expects($this->any())->method('getSeleniumUrl')->willReturn('not_empty');
122
        $this->seleniumOptions->expects($this->any())->method('getSeleniumJarLocation')->willReturn($jarLocation);
123
        $this->seleniumOptions->expects($this->any())->method('getSeleniumExtraArguments')->willReturn(['port' => $port]);
124
        $this->process->expects($this->any())->method('setCommandLine')->with($javaLocation.' -jar '.$jarLocation.' -port '.$port);
125
        $this->starter->start();
126
    }
127
128
    public function testStarterStartsWithPortByOptions()
129
    {
@@ 128-140 (lines=13) @@
125
        $this->starter->start();
126
    }
127
128
    public function testStarterStartsWithPortByOptions()
129
    {
130
        $jarLocation = __DIR__.'/../fixtures/selenium-dummy.jar';
131
        $javaLocation = 'java-location';
132
        $port = 1234;
133
        $this->exeFinder->expects($this->any())->method('find')->with('java')->willReturn($javaLocation);
134
        $this->seleniumOptions->expects($this->any())->method('getSeleniumQuery')->willReturn('not_empty');
135
        $this->seleniumOptions->expects($this->any())->method('getSeleniumUrl')->willReturn('not_empty');
136
        $this->seleniumOptions->expects($this->any())->method('getSeleniumJarLocation')->willReturn($jarLocation);
137
        $this->seleniumOptions->expects($this->any())->method('getSeleniumPort')->willReturn($port);
138
        $this->process->expects($this->any())->method('setCommandLine')->with($javaLocation.' -jar '.$jarLocation.' -port '.$port);
139
        $this->starter->start();
140
    }
141
}
142