| Total Complexity | 2 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ConfigurationTest extends TestCase |
||
| 9 | { |
||
| 10 | public function configDataProvider(): array |
||
| 11 | { |
||
| 12 | return [ |
||
| 13 | [ |
||
| 14 | 'empty', |
||
| 15 | [ |
||
| 16 | ], |
||
| 17 | [ |
||
| 18 | 'default_connection' => null, |
||
| 19 | 'default_serializer' => 'bdf', |
||
| 20 | 'failer' => 'memory:', |
||
| 21 | 'connections' => [], |
||
| 22 | 'destinations' => [], |
||
| 23 | ], |
||
| 24 | ], |
||
| 25 | [ |
||
| 26 | 'consumer options', |
||
| 27 | [ |
||
| 28 | 'destinations' => [ |
||
| 29 | 'foo' => [ |
||
| 30 | 'consumer' => [ |
||
| 31 | 'no_reset' => true, |
||
| 32 | 'retry' => 2, |
||
| 33 | 'max' => 3, |
||
| 34 | 'limit' => 4, |
||
| 35 | 'memory' => 128, |
||
| 36 | 'save' => true, |
||
| 37 | 'no_failure' => true, |
||
| 38 | 'stop_when_empty' => true, |
||
| 39 | 'auto_handle' => false, |
||
| 40 | ] |
||
| 41 | ] |
||
| 42 | ], |
||
| 43 | ], |
||
| 44 | [ |
||
| 45 | 'destinations' => [ |
||
| 46 | 'foo' => [ |
||
| 47 | 'consumer' => [ |
||
| 48 | 'no_reset' => true, |
||
| 49 | 'retry' => 2, |
||
| 50 | 'max' => 3, |
||
| 51 | 'limit' => 4, |
||
| 52 | 'memory' => 128, |
||
| 53 | 'save' => true, |
||
| 54 | 'no_failure' => true, |
||
| 55 | 'stop_when_empty' => true, |
||
| 56 | 'auto_handle' => false, |
||
| 57 | 'handler' => null, |
||
| 58 | 'middlewares' => [], |
||
| 59 | ] |
||
| 60 | ] |
||
| 61 | ], |
||
| 62 | 'default_connection' => null, |
||
| 63 | 'default_serializer' => 'bdf', |
||
| 64 | 'failer' => 'memory:', |
||
| 65 | 'connections' => [], |
||
| 66 | ], |
||
| 67 | ], |
||
| 68 | ]; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @dataProvider configDataProvider |
||
| 73 | */ |
||
| 74 | public function test_valid_config(string $description, array $config, array $expected) |
||
| 81 | } |
||
| 82 | } |
||
| 83 |