Skip to content

Commit

Permalink
Add test for issue 71
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0Vu committed May 18, 2018
1 parent 831d2eb commit 4eaebd4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/unit/EthabiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,23 @@ public function testDecodeParameters()
}
}
}

/**
* testIssue71
* test 33 bytes and 128 bytes string, see: https://github.com/sc0Vu/web3.php/issues/71
* string generated from: https://www.lipsum.com/
*
* @return void
*/
public function testIssue71()
{
$abi = $this->abi;
$specialString = 'Lorem ipsum dolor sit amet metus.';
$encodedString = $abi->encodeParameter('string', $specialString);
$this->assertEquals($specialString, $abi->decodeParameter('string', $encodedString));

$specialString = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce pulvinar quam felis, suscipit posuere neque aliquam in cras amet.';
$encodedString = $abi->encodeParameter('string', $specialString);
$this->assertEquals($specialString, $abi->decodeParameter('string', $encodedString));
}
}

0 comments on commit 4eaebd4

Please sign in to comment.