1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace Test\Unit;
- use InvalidArgumentException;
- 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, true);
- $boolean = $formatter->format(1);
- $this->assertEquals($boolean, true);
- $boolean = $formatter->format(false);
- $this->assertEquals($boolean, false);
- $boolean = $formatter->format(0);
- $this->assertEquals($boolean, false);
- }
- }
|