diff --git a/test/unit/BigNumberFormatterTest.php b/test/unit/BigNumberFormatterTest.php new file mode 100644 index 0000000..7b96704 --- /dev/null +++ b/test/unit/BigNumberFormatterTest.php @@ -0,0 +1,42 @@ +formatter = new BigNumberFormatter; + } + + /** + * testFormat + * + * @return void + */ + public function testFormat() + { + $formatter = $this->formatter; + + $bigNumber = $formatter->format(1); + $this->assertEquals($bigNumber->toString(), '1'); + $this->assertTrue($bigNumber instanceof BigNumber); + } +} \ No newline at end of file diff --git a/test/unit/BooleanFormatterTest.php b/test/unit/BooleanFormatterTest.php index 2522092..3736123 100644 --- a/test/unit/BooleanFormatterTest.php +++ b/test/unit/BooleanFormatterTest.php @@ -10,7 +10,7 @@ class BooleanFormatterTest extends TestCase /** * formatter * - * @var \Web3\Formatters\Boolean + * @var \Web3\Formatters\BooleanFormatter */ protected $formatter; @@ -35,11 +35,9 @@ class BooleanFormatterTest extends TestCase $formatter = $this->formatter; $boolean = $formatter->format(true); - $this->assertEquals($boolean, 1); $boolean = $formatter->format(false); - $this->assertEquals($boolean, 0); } } \ No newline at end of file diff --git a/test/unit/IntegerFormatterTest.php b/test/unit/IntegerFormatterTest.php index 523d0bf..193e19d 100644 --- a/test/unit/IntegerFormatterTest.php +++ b/test/unit/IntegerFormatterTest.php @@ -10,7 +10,7 @@ class IntegerFormatterTest extends TestCase /** * formatter * - * @var \Web3\Formatters\Integer + * @var \Web3\Formatters\IntegerFormatter */ protected $formatter; @@ -35,15 +35,15 @@ class IntegerFormatterTest extends TestCase $formatter = $this->formatter; $hex = $formatter->format('1'); - $this->assertEquals($hex, implode('', array_fill(0, 63, '0')) . '1'); $hex = $formatter->format('-1'); - $this->assertEquals($hex, implode('', array_fill(0, 64, 'f'))); $hex = $formatter->format('ae'); - $this->assertEquals($hex, implode('', array_fill(0, 62, '0')) . 'ae'); + + $hex = $formatter->format('1', 20); + $this->assertEquals($hex, implode('', array_fill(0, 19, '0')) . '1'); } } \ No newline at end of file