add new test case

This commit is contained in:
itismadness
2018-03-27 09:54:31 -10:00
parent d99032f9eb
commit 53bdf98f35

View File

@@ -77,6 +77,24 @@ class BencodeTorrentTest extends TestCase {
}
public function testSetData() {
$data = [
'encoding' => 'UTF8',
'info' => [
'name' => 'test',
'length' => 1213134,
'pieces' => 'fake pieces string'
]
];
$bencode = new BencodeTorrent();
try {
$bencode->setData($data);
}
catch (\Exception $exc) {
$this->fail('Exception should not have been thrown');
}
$data = $bencode->getData();
$this->assertEquals('UTF8', $data['encoding']);
}
}