@@ -2,13 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Magium\Cli\Command; |
4 | 4 | |
5 | -use Magium\InvalidConfigurationException; |
|
6 | -use Magium\NotFoundException; |
|
7 | 5 | use Symfony\Component\Console\Command\Command; |
8 | 6 | use Symfony\Component\Console\Input\ArrayInput; |
9 | -use Symfony\Component\Console\Input\InputArgument; |
|
10 | 7 | use Symfony\Component\Console\Input\InputInterface; |
11 | -use Symfony\Component\Console\Input\InputOption; |
|
12 | 8 | use Symfony\Component\Console\Output\OutputInterface; |
13 | 9 | |
14 | 10 | abstract class AbstractApiEnablement extends Command |
@@ -2,14 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Magium\Cli\Command; |
4 | 4 | |
5 | -use Magium\InvalidConfigurationException; |
|
6 | -use Magium\NotFoundException; |
|
7 | 5 | use Symfony\Component\Console\Command\Command; |
8 | -use Symfony\Component\Console\Input\ArrayInput; |
|
9 | -use Symfony\Component\Console\Input\InputArgument; |
|
10 | -use Symfony\Component\Console\Input\InputInterface; |
|
11 | -use Symfony\Component\Console\Input\InputOption; |
|
12 | -use Symfony\Component\Console\Output\OutputInterface; |
|
13 | 6 | |
14 | 7 | class ApiEnable extends AbstractApiEnablement |
15 | 8 | { |
@@ -4,14 +4,9 @@ |
||
4 | 4 | |
5 | 5 | use Guzzle\Http\Client; |
6 | 6 | use Magium\Cli\Command\Test\TestSkeleton; |
7 | -use Magium\InvalidConfigurationException; |
|
8 | -use Magium\NotFoundException; |
|
9 | 7 | use Magium\Util\Api\ApiConfiguration; |
10 | 8 | use Symfony\Component\Console\Command\Command; |
11 | -use Symfony\Component\Console\Input\ArrayInput; |
|
12 | -use Symfony\Component\Console\Input\InputArgument; |
|
13 | 9 | use Symfony\Component\Console\Input\InputInterface; |
14 | -use Symfony\Component\Console\Input\InputOption; |
|
15 | 10 | use Symfony\Component\Console\Output\OutputInterface; |
16 | 11 | |
17 | 12 | class ApiPing extends Command |
@@ -33,21 +33,21 @@ discard block |
||
33 | 33 | $api->setEnabled(true); // Gotta force this for this test |
34 | 34 | |
35 | 35 | $output->writeln('Sending un-authenticated payload...'); |
36 | - $client = new Client('http://' . $api->getApiHostname(). '/api/ping'); |
|
36 | + $client = new Client('http://' . $api->getApiHostname() . '/api/ping'); |
|
37 | 37 | $request = $client->get(); |
38 | 38 | $response = $request->send(); |
39 | 39 | $output->writeln( |
40 | 40 | 'Checking for 200 status message... ' |
41 | - . ($response->getStatusCode() == '200'?'OK':'Failed') |
|
41 | + . ($response->getStatusCode() == '200' ? 'OK' : 'Failed') |
|
42 | 42 | ); |
43 | 43 | $output->writeln( |
44 | 44 | 'Checking for application/json content type... ' |
45 | - . (stripos($response->getContentType(), 'application/json') !== false?'OK':'Failed') |
|
45 | + . (stripos($response->getContentType(), 'application/json') !== false ? 'OK' : 'Failed') |
|
46 | 46 | ); |
47 | 47 | $content = json_decode($response->getBody(), true); |
48 | 48 | $output->writeln( |
49 | 49 | 'Checking for successful response... ' |
50 | - . (is_array($content) && isset($content['status']) && $content['status'] === 'success'?'OK':'Failed') |
|
50 | + . (is_array($content) && isset($content['status']) && $content['status'] === 'success' ? 'OK' : 'Failed') |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | $output->writeln(''); |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | |
60 | 60 | $output->writeln( |
61 | 61 | 'Checking for 200 status message... ' |
62 | - . ($response->getStatusCode() == '200'?'OK':'Failed') |
|
62 | + . ($response->getStatusCode() == '200' ? 'OK' : 'Failed') |
|
63 | 63 | ); |
64 | 64 | $output->writeln( |
65 | 65 | 'Checking for application/json content type... ' |
66 | - . (stripos($response->getContentType(), 'application/json') !== false?'OK':'Failed') |
|
66 | + . (stripos($response->getContentType(), 'application/json') !== false ? 'OK' : 'Failed') |
|
67 | 67 | ); |
68 | 68 | $content = $request->getPayload($response); |
69 | 69 | $output->writeln( |
70 | 70 | 'Checking for successful response... ' |
71 | - . (is_array($content) && isset($content['status']) && $content['status'] === 'success'?'OK':'Failed') |
|
71 | + . (is_array($content) && isset($content['status']) && $content['status'] === 'success' ? 'OK' : 'Failed') |
|
72 | 72 | ); |
73 | 73 | |
74 | 74 | |
@@ -79,20 +79,20 @@ discard block |
||
79 | 79 | $response = $request->push('/api/echo-authed', ['message' => 'hello world']); |
80 | 80 | $output->writeln( |
81 | 81 | 'Checking for 200 status message... ' |
82 | - . ($response->getStatusCode() == '200'?'OK':'Failed') |
|
82 | + . ($response->getStatusCode() == '200' ? 'OK' : 'Failed') |
|
83 | 83 | ); |
84 | 84 | $output->writeln( |
85 | 85 | 'Checking for application/json content type... ' |
86 | - . (stripos($response->getContentType(), 'application/json') !== false?'OK':'Failed') |
|
86 | + . (stripos($response->getContentType(), 'application/json') !== false ? 'OK' : 'Failed') |
|
87 | 87 | ); |
88 | 88 | $content = $request->getPayload($response); |
89 | 89 | $output->writeln( |
90 | 90 | 'Checking for successful response... ' |
91 | - . (is_array($content) && isset($content['status']) && $content['status'] === 'success'?'OK':'Failed') |
|
91 | + . (is_array($content) && isset($content['status']) && $content['status'] === 'success' ? 'OK' : 'Failed') |
|
92 | 92 | ); |
93 | 93 | $output->writeln( |
94 | 94 | 'Checking for matching echo message... ' |
95 | - . (is_array($content) && isset($content['message']) && $content['message'] === 'hello world'?'OK':'Failed') |
|
95 | + . (is_array($content) && isset($content['message']) && $content['message'] === 'hello world' ? 'OK' : 'Failed') |
|
96 | 96 | ); |
97 | 97 | } |
98 | 98 |
@@ -2,14 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Magium\Cli\Command; |
4 | 4 | |
5 | -use Magium\InvalidConfigurationException; |
|
6 | -use Magium\NotFoundException; |
|
7 | 5 | use Symfony\Component\Console\Command\Command; |
8 | -use Symfony\Component\Console\Input\ArrayInput; |
|
9 | -use Symfony\Component\Console\Input\InputArgument; |
|
10 | -use Symfony\Component\Console\Input\InputInterface; |
|
11 | -use Symfony\Component\Console\Input\InputOption; |
|
12 | -use Symfony\Component\Console\Output\OutputInterface; |
|
13 | 6 | |
14 | 7 | class ApiEnable extends AbstractApiEnablement |
15 | 8 | { |