| Conditions | 1 |
| Paths | 1 |
| Total Lines | 70 |
| Code Lines | 47 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 17 | public function test_load_() |
||
| 18 | { |
||
| 19 | $this->load(array( |
||
| 20 | 'delete_allowed' => true, |
||
| 21 | 'connections' => array( |
||
| 22 | 'default' => 'http://user:password@localhost:15672', |
||
| 23 | ), |
||
| 24 | 'vhosts' => array( |
||
| 25 | 'test' => array( |
||
| 26 | 'name' => '/test', |
||
| 27 | 'connection' => 'default', |
||
| 28 | 'permissions' => array( |
||
| 29 | 'lafourchette' => NULL, |
||
| 30 | ), |
||
| 31 | 'exchanges' => array( |
||
| 32 | 'lf.exchange.a' => NULL, |
||
| 33 | 'lf.exchange.b' => array( |
||
| 34 | 'type' => 'direct', |
||
| 35 | ), |
||
| 36 | 'lf.exchange.c' => NULL, |
||
| 37 | ), |
||
| 38 | 'queues' => array( |
||
| 39 | 'lf.queue.a' => array( |
||
| 40 | 'bindings' => array( |
||
| 41 | array( |
||
| 42 | 'exchange' => 'lf.exchange.a', |
||
| 43 | 'routing_key' => 'a.#', |
||
| 44 | ), |
||
| 45 | array( |
||
| 46 | 'exchange' => 'lf.exchange.b', |
||
| 47 | 'routing_key' => 'b.#', |
||
| 48 | ), |
||
| 49 | ), |
||
| 50 | ), |
||
| 51 | 'lf.queue.b' => array( |
||
| 52 | 'bindings' => array( |
||
| 53 | array( |
||
| 54 | 'exchange' => 'lf.exchange.a', |
||
| 55 | 'routing_key' => 'a.#', |
||
| 56 | ), |
||
| 57 | array( |
||
| 58 | 'exchange' => 'lf.exchange.b', |
||
| 59 | 'routing_key' => 'b.#', |
||
| 60 | ), |
||
| 61 | array( |
||
| 62 | 'exchange' => 'lf.exchange.c', |
||
| 63 | 'routing_key' => 'c.#', |
||
| 64 | ), |
||
| 65 | ), |
||
| 66 | ), |
||
| 67 | 'lf.queue.c' => array( |
||
| 68 | 'bindings' => array( |
||
| 69 | array( |
||
| 70 | 'exchange' => 'lf.exchange.a', |
||
| 71 | 'routing_key' => 'a.#', |
||
| 72 | ), |
||
| 73 | array( |
||
| 74 | 'exchange' => 'lf.exchange.c', |
||
| 75 | 'routing_key' => 'c.#', |
||
| 76 | ), |
||
| 77 | ), |
||
| 78 | ), |
||
| 79 | ), |
||
| 80 | ), |
||
| 81 | ), |
||
| 82 | )); |
||
| 83 | $this->assertContainerBuilderHasService('ola_rabbit_mq_admin_toolkit.connection.default'); |
||
| 84 | $this->assertContainerBuilderHasService('ola_rabbit_mq_admin_toolkit.configuration.test'); |
||
| 85 | $this->assertContainerBuilderHasParameter('ola_rabbit_mq_admin_toolkit.default_vhost'); |
||
| 86 | } |
||
| 87 | } |
||
| 88 |