Skip to content

Commit

Permalink
Write testAddMany() method for test addMany() method of Http/Client/F…
Browse files Browse the repository at this point in the history
…ormData.php
  • Loading branch information
sohelrana820 committed Mar 30, 2018
1 parent 8abe035 commit 539ad83
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/TestCase/Http/Client/FormDataTest.php
Expand Up @@ -69,6 +69,22 @@ public function testAddSimple()
$this->assertEquals($expected, $result);
}

public function testAddMany()
{
$data = new FormData();
$array = [
'key' => 'value',
'empty' => '',
'int' => '1',
'float' => '2.3'
];
$data->addMany($array);
$this->assertCount(4, $data);
$result = (string)$data;
$expected = 'key=value&empty=&int=1&float=2.3';
$this->assertEquals($expected, $result);
}

/**
* Test adding a part object.
*
Expand Down

0 comments on commit 539ad83

Please sign in to comment.