Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
3 / 6 |
|
50.00% |
3 / 6 |
CRAP | |
0.00% |
0 / 1 |
| MockServer | |
50.00% |
3 / 6 |
|
50.00% |
3 / 6 |
10.50 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAddress | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| connect | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| pause | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| resume | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| close | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\FtpServer\Factories; |
| 3 | |
| 4 | use Evenement\EventEmitter; |
| 5 | use React\Socket\ServerInterface; |
| 6 | |
| 7 | class MockServer extends EventEmitter implements ServerInterface |
| 8 | { |
| 9 | private bool $closed = false; |
| 10 | |
| 11 | public function __construct(public readonly int $port) |
| 12 | { |
| 13 | } |
| 14 | |
| 15 | public function getAddress(): string |
| 16 | { |
| 17 | return '127.0.0.1:' . $this->port; |
| 18 | } |
| 19 | |
| 20 | public function connect(): void |
| 21 | { |
| 22 | $this->emit('connect'); |
| 23 | } |
| 24 | |
| 25 | public function pause(): void |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | public function resume(): void |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | public function close(): void |
| 34 | { |
| 35 | $this->closed = true; |
| 36 | } |
| 37 | } |