Exemplo n.º 1
0
 public function testHasFields()
 {
     $b = new PostBody();
     $b->setField('foo', 'bar');
     $b->setField('baz', '123');
     $this->assertEquals('bar', $b->getField('foo'));
     $this->assertEquals('123', $b->getField('baz'));
     $this->assertNull($b->getField('ahh'));
     $this->assertTrue($b->hasField('foo'));
     $this->assertFalse($b->hasField('test'));
     $b->replaceFields(['abc' => '123']);
     $this->assertFalse($b->hasField('foo'));
     $this->assertTrue($b->hasField('abc'));
 }