| @@ 14-38 (lines=25) @@ | ||
| 11 | 'tres' => 3 |
|
| 12 | ); |
|
| 13 | ||
| 14 | public function testGetter() { |
|
| 15 | ||
| 16 | $array = new ArrayDebugger($this->base); |
|
| 17 | ||
| 18 | $array->setLogger(function($retorno) { |
|
| 19 | $this->assertEquals($retorno['type'], ArrayDebugger::TYPE_GET); |
|
| 20 | }); |
|
| 21 | ||
| 22 | $teste = $array['hum']; |
|
| 23 | ||
| 24 | $array->setLogger(function($retorno) { |
|
| 25 | $this->assertNotEquals($retorno['type'], ArrayDebugger::TYPE_GET); |
|
| 26 | }); |
|
| 27 | ||
| 28 | $array['quatro'] = 4; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * offsetExists |
|
| 32 | */ |
|
| 33 | isset($array['hum']); |
|
| 34 | /** |
|
| 35 | * offsetUnset |
|
| 36 | */ |
|
| 37 | unset($array['quatro']); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testSetter() { |
|
| 41 | ||
| @@ 40-64 (lines=25) @@ | ||
| 37 | unset($array['quatro']); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testSetter() { |
|
| 41 | ||
| 42 | $array = new ArrayDebugger($this->base); |
|
| 43 | ||
| 44 | $array->setLogger(function($retorno) { |
|
| 45 | $this->assertEquals($retorno['type'], ArrayDebugger::TYPE_SET); |
|
| 46 | }); |
|
| 47 | ||
| 48 | $array['quatro'] = 4; |
|
| 49 | ||
| 50 | $array->setLogger(function($retorno) { |
|
| 51 | $this->assertNotEquals($retorno['type'], ArrayDebugger::TYPE_SET); |
|
| 52 | }); |
|
| 53 | ||
| 54 | $teste = $array['hum']; |
|
| 55 | ||
| 56 | /** |
|
| 57 | * offsetExists |
|
| 58 | */ |
|
| 59 | isset($array['hum']); |
|
| 60 | /** |
|
| 61 | * offsetUnset |
|
| 62 | */ |
|
| 63 | unset($array['quatro']); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testIsset() { |
|
| 67 | ||
| @@ 66-92 (lines=27) @@ | ||
| 63 | unset($array['quatro']); |
|
| 64 | } |
|
| 65 | ||
| 66 | public function testIsset() { |
|
| 67 | ||
| 68 | $array = new ArrayDebugger($this->base); |
|
| 69 | ||
| 70 | $array->setLogger(function($retorno) { |
|
| 71 | $this->assertEquals($retorno['type'], ArrayDebugger::TYPE_EXISTS); |
|
| 72 | }); |
|
| 73 | ||
| 74 | ||
| 75 | /** |
|
| 76 | * offsetExists |
|
| 77 | */ |
|
| 78 | isset($array['hum']); |
|
| 79 | ||
| 80 | $array->setLogger(function($retorno) { |
|
| 81 | $this->assertNotEquals($retorno['type'], ArrayDebugger::TYPE_EXISTS); |
|
| 82 | }); |
|
| 83 | ||
| 84 | $array['quatro'] = 4; |
|
| 85 | ||
| 86 | $teste = $array['hum']; |
|
| 87 | ||
| 88 | /** |
|
| 89 | * offsetUnset |
|
| 90 | */ |
|
| 91 | unset($array['quatro']); |
|
| 92 | } |
|
| 93 | ||
| 94 | public function testUnset() { |
|
| 95 | ||
| @@ 94-119 (lines=26) @@ | ||
| 91 | unset($array['quatro']); |
|
| 92 | } |
|
| 93 | ||
| 94 | public function testUnset() { |
|
| 95 | ||
| 96 | $array = new ArrayDebugger($this->base); |
|
| 97 | ||
| 98 | $array->setLogger(function($retorno) { |
|
| 99 | $this->assertEquals($retorno['type'], ArrayDebugger::TYPE_UNSET); |
|
| 100 | }); |
|
| 101 | ||
| 102 | /** |
|
| 103 | * offsetUnset |
|
| 104 | */ |
|
| 105 | unset($array['dois']); |
|
| 106 | ||
| 107 | $array->setLogger(function($retorno) { |
|
| 108 | $this->assertNotEquals($retorno['type'], ArrayDebugger::TYPE_UNSET); |
|
| 109 | }); |
|
| 110 | /** |
|
| 111 | * offsetExists |
|
| 112 | */ |
|
| 113 | isset($array['hum']); |
|
| 114 | ||
| 115 | $array['quatro'] = 4; |
|
| 116 | ||
| 117 | $teste = $array['hum']; |
|
| 118 | ||
| 119 | } |
|
| 120 | } |
|
| 121 | ||