| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | function test_add_get_methods() { |
||
|
|
|||
| 20 | $obj = new MslsJson(); |
||
| 21 | $obj->add( null, 'Test 3' ) |
||
| 22 | ->add( '2', 'Test 2' ) |
||
| 23 | ->add( 1, 'Test 1' ); |
||
| 24 | |||
| 25 | $expected = [ |
||
| 26 | [ 'value' => 1, 'label' => 'Test 1' ], |
||
| 27 | [ 'value' => 2, 'label' => 'Test 2' ], |
||
| 28 | [ 'value' => 0, 'label' => 'Test 3' ], |
||
| 29 | ]; |
||
| 30 | $this->assertEquals( $expected, $obj->get() ); |
||
| 31 | |||
| 32 | return $obj; |
||
| 33 | } |
||
| 34 | |||
| 47 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.