| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | function test_is_empty_method() { |
||
|
|
|||
| 20 | $obj = new MslsGetSet(); |
||
| 21 | |||
| 22 | $this->assertTrue( $obj->is_empty() ); |
||
| 23 | $obj->abc = 'test'; |
||
| 24 | |||
| 25 | $this->assertEquals( 'test' , $obj->abc ); |
||
| 26 | $this->assertTrue( isset( $obj->abc ) ); |
||
| 27 | $this->assertFalse( $obj->is_empty() ); |
||
| 28 | |||
| 29 | unset( $obj->abc ); |
||
| 30 | $this->assertTrue( $obj->is_empty() ); |
||
| 31 | |||
| 32 | $obj->temp = 'test'; |
||
| 33 | |||
| 34 | $this->assertTrue( $obj->has_value( 'temp' ) ); |
||
| 35 | |||
| 36 | $this->assertEquals( array( 'temp' => 'test' ), $obj->get_arr() ); |
||
| 37 | |||
| 38 | $obj->reset(); |
||
| 39 | $this->assertEquals( array(), $obj->get_arr() ); |
||
| 40 | } |
||
| 41 | |||
| 43 |
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.