Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | public function testCommand() |
||
14 | { |
||
15 | $container = []; |
||
16 | $response = $this->getMockHttpResponse('CreateClassifierSuccess.txt'); |
||
17 | $httpClient = $this->getMockHttpClientWithHistoryAndResponses($container, [$response]); |
||
18 | |||
19 | $arguments = [ |
||
20 | 'username' => 'test', |
||
21 | 'password' => 'test', |
||
22 | 'positive_examples' => 'Tests/images/butterfly-positive.zip', |
||
23 | 'negative_examples' => 'Tests/images/butterfly-negative.zip', |
||
24 | 'name' => 'butterfly', |
||
25 | '--version-date' => '2016-01-01' |
||
26 | ]; |
||
27 | $input = new ArrayInput($arguments); |
||
28 | |||
29 | $output = new BufferedOutput(); |
||
30 | |||
31 | $command = new CreateClassifierCommand(null, new Client($httpClient)); |
||
32 | $command->run($input, $output); |
||
33 | |||
34 | $this->assertEquals('classifier:create', $command->getName()); |
||
35 | |||
36 | $correctOutput = file_get_contents('Tests/Mock/Commands/CreateClassifierSuccess.txt'); |
||
37 | |||
38 | $this->assertEquals($correctOutput, $output->fetch()); |
||
39 | } |
||
40 | } |
||
41 |