web3.php/test/unit/BooleanFormatterTest.php
2018-02-07 16:45:02 +08:00

43 lines
743 B
PHP

<?php
namespace Test\Unit;
use Test\TestCase;
use Web3\Formatters\BooleanFormatter;
class BooleanFormatterTest extends TestCase
{
/**
* formatter
*
* @var \Web3\Formatters\BooleanFormatter
*/
protected $formatter;
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
$this->formatter = new BooleanFormatter;
}
/**
* testFormat
*
* @return void
*/
public function testFormat()
{
$formatter = $this->formatter;
$boolean = $formatter->format(true);
$this->assertEquals($boolean, 1);
$boolean = $formatter->format(false);
$this->assertEquals($boolean, 0);
}
}