@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function setUp(): void |
24 | 24 | { |
25 | 25 | exec('protoc 2>&1', $out); |
26 | - if (strpos(implode("\n", $out), '--php_out') === false) { |
|
26 | + if (strpos(implode("\n", $out), '--php_out') === false){ |
|
27 | 27 | $this->markTestSkipped('Protoc binary is missing'); |
28 | 28 | } |
29 | 29 | |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $fs = new Files(); |
33 | 33 | |
34 | 34 | $this->runCommandDebug('grpc:generate', [ |
35 | - 'proto' => realpath($fs->normalizePath($this->app->dir('app') . 'proto/service.proto')) |
|
35 | + 'proto' => realpath($fs->normalizePath($this->app->dir('app').'proto/service.proto')) |
|
36 | 36 | ]); |
37 | 37 | |
38 | - $output = $this->app->dir('app') . 'src/Service/EchoService.php'; |
|
38 | + $output = $this->app->dir('app').'src/Service/EchoService.php'; |
|
39 | 39 | file_put_contents($output, GenerateTest::SERVICE); |
40 | 40 | } |
41 | 41 | |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | |
46 | 46 | $fs = new Files(); |
47 | 47 | |
48 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
49 | - $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
|
48 | + if ($fs->isDirectory($this->app->dir('app').'src/Service')){ |
|
49 | + $fs->deleteDirectory($this->app->dir('app').'src/Service'); |
|
50 | 50 | } |
51 | 51 | |
52 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
53 | - $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
|
52 | + if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){ |
|
53 | + $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata'); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $msg->setMsg('hello'); |
77 | 77 | |
78 | 78 | $w->shouldReceive('receive')->once()->with( |
79 | - \Mockery::on(function (&$context) { |
|
79 | + \Mockery::on(function (&$context){ |
|
80 | 80 | $context = '{ |
81 | 81 | "service": "service.Echo", |
82 | 82 | "method": "Ping", |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | )->andReturn($msg->serializeToString()); |
89 | 89 | |
90 | 90 | $w->shouldReceive('send')->once()->with( |
91 | - \Mockery::on(function ($out) { |
|
91 | + \Mockery::on(function ($out){ |
|
92 | 92 | $msg = new Message(); |
93 | 93 | $msg->mergeFromString($out); |
94 | 94 | $this->assertSame('hello', $msg->getMsg()); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // one command only |
102 | 102 | $w->shouldReceive('receive')->once()->with( |
103 | - \Mockery::on(function (&$context) { |
|
103 | + \Mockery::on(function (&$context){ |
|
104 | 104 | $context = null; |
105 | 105 | return true; |
106 | 106 | }) |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $msg->setMsg('hello'); |
121 | 121 | |
122 | 122 | $w->shouldReceive('receive')->once()->with( |
123 | - \Mockery::on(function (&$context) { |
|
123 | + \Mockery::on(function (&$context){ |
|
124 | 124 | $context = '{ |
125 | 125 | "service": "service.Echo", |
126 | 126 | "method": "Invalid", |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | )->andReturn($msg->serializeToString()); |
133 | 133 | |
134 | 134 | $w->shouldReceive('error')->once()->with( |
135 | - \Mockery::on(function ($out) { |
|
135 | + \Mockery::on(function ($out){ |
|
136 | 136 | $this->assertStringContainsString('Method `Invalid` not found', $out); |
137 | 137 | return true; |
138 | 138 | }) |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | // one command only |
142 | 142 | $w->shouldReceive('receive')->once()->with( |
143 | - \Mockery::on(function (&$context) { |
|
143 | + \Mockery::on(function (&$context){ |
|
144 | 144 | $context = null; |
145 | 145 | return true; |
146 | 146 | }) |
@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | public function setUp(): void |
24 | 24 | { |
25 | 25 | exec('protoc 2>&1', $out); |
26 | - if (strpos(implode("\n", $out), '--php_out') === false) { |
|
26 | + if (strpos(implode("\n", $out), '--php_out') === false) |
|
27 | + { |
|
27 | 28 | $this->markTestSkipped('Protoc binary is missing'); |
28 | 29 | } |
29 | 30 | |
@@ -45,11 +46,13 @@ discard block |
||
45 | 46 | |
46 | 47 | $fs = new Files(); |
47 | 48 | |
48 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
49 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
50 | + { |
|
49 | 51 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
50 | 52 | } |
51 | 53 | |
52 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
54 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
55 | + { |
|
53 | 56 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
54 | 57 | } |
55 | 58 | } |
@@ -76,7 +79,8 @@ discard block |
||
76 | 79 | $msg->setMsg('hello'); |
77 | 80 | |
78 | 81 | $w->shouldReceive('receive')->once()->with( |
79 | - \Mockery::on(function (&$context) { |
|
82 | + \Mockery::on(function (&$context) |
|
83 | + { |
|
80 | 84 | $context = '{ |
81 | 85 | "service": "service.Echo", |
82 | 86 | "method": "Ping", |
@@ -88,7 +92,8 @@ discard block |
||
88 | 92 | )->andReturn($msg->serializeToString()); |
89 | 93 | |
90 | 94 | $w->shouldReceive('send')->once()->with( |
91 | - \Mockery::on(function ($out) { |
|
95 | + \Mockery::on(function ($out) |
|
96 | + { |
|
92 | 97 | $msg = new Message(); |
93 | 98 | $msg->mergeFromString($out); |
94 | 99 | $this->assertSame('hello', $msg->getMsg()); |
@@ -100,7 +105,8 @@ discard block |
||
100 | 105 | |
101 | 106 | // one command only |
102 | 107 | $w->shouldReceive('receive')->once()->with( |
103 | - \Mockery::on(function (&$context) { |
|
108 | + \Mockery::on(function (&$context) |
|
109 | + { |
|
104 | 110 | $context = null; |
105 | 111 | return true; |
106 | 112 | }) |
@@ -120,7 +126,8 @@ discard block |
||
120 | 126 | $msg->setMsg('hello'); |
121 | 127 | |
122 | 128 | $w->shouldReceive('receive')->once()->with( |
123 | - \Mockery::on(function (&$context) { |
|
129 | + \Mockery::on(function (&$context) |
|
130 | + { |
|
124 | 131 | $context = '{ |
125 | 132 | "service": "service.Echo", |
126 | 133 | "method": "Invalid", |
@@ -132,7 +139,8 @@ discard block |
||
132 | 139 | )->andReturn($msg->serializeToString()); |
133 | 140 | |
134 | 141 | $w->shouldReceive('error')->once()->with( |
135 | - \Mockery::on(function ($out) { |
|
142 | + \Mockery::on(function ($out) |
|
143 | + { |
|
136 | 144 | $this->assertStringContainsString('Method `Invalid` not found', $out); |
137 | 145 | return true; |
138 | 146 | }) |
@@ -140,7 +148,8 @@ discard block |
||
140 | 148 | |
141 | 149 | // one command only |
142 | 150 | $w->shouldReceive('receive')->once()->with( |
143 | - \Mockery::on(function (&$context) { |
|
151 | + \Mockery::on(function (&$context) |
|
152 | + { |
|
144 | 153 | $context = null; |
145 | 154 | return true; |
146 | 155 | }) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $parameters->set(Option::PACKAGE_ALIAS_FORMAT, '<major>.<minor>.x-dev'); |
37 | 37 | |
38 | 38 | $parameters->set(Option::PACKAGE_DIRECTORIES, [ |
39 | - __DIR__ . '/src', |
|
39 | + __DIR__.'/src', |
|
40 | 40 | ]); |
41 | 41 | |
42 | 42 | $parameters->set(Option::DATA_TO_APPEND, [ |
@@ -100,6 +100,6 @@ discard block |
||
100 | 100 | ]); |
101 | 101 | |
102 | 102 | $parameters->set(Option::DIRECTORIES_TO_REPOSITORIES, [ |
103 | - __DIR__ . '/src/Core' => '[email protected]:spiral/core.git', |
|
103 | + __DIR__.'/src/Core' => '[email protected]:spiral/core.git', |
|
104 | 104 | ]); |
105 | 105 | }; |