public function test_has_get_set_forget() { $c = new Map(['a', 'b', 'c']); $this->assertTrue($c->has(0)); $this->assertFalse($c->has(5)); $r = $c->forget(0); $this->assertSame($c, $r); $this->assertFalse($c->has(0)); $this->assertSame('b', $c->get(1)); $r = $c->set(1, 'B'); $this->assertSame($c, $r); $this->assertSame('B', $c->get(1)); $c->set(5, 'C'); $this->assertTrue($c->has(5)); }
/** * @dataProvider provider__construct */ public function test_has($base) { $map = new Map($base); foreach ($base as $key => $value) { $this->assertTrue($map->has($key)); } }
public function testHas() { $this->assertTrue($this->properties->has('foo1')); $this->assertFalse($this->properties->has('foo4')); }