BooleanValidatorTest.php 840 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Test\Unit;
  3. use Test\TestCase;
  4. use Web3\Validators\BooleanValidator;
  5. class BooleanValidatorTest extends TestCase
  6. {
  7. /**
  8. * validator
  9. *
  10. * @var \Web3\Validators\BooleanValidator
  11. */
  12. protected $validator;
  13. /**
  14. * setUp
  15. *
  16. * @return void
  17. */
  18. public function setUp()
  19. {
  20. parent::setUp();
  21. $this->validator = new BooleanValidator;
  22. }
  23. /**
  24. * testValidate
  25. *
  26. * @return void
  27. */
  28. public function testValidate()
  29. {
  30. $validator = $this->validator;
  31. $this->assertEquals(false, $validator->validate('0XCA35B7D915458EF540ADE6068DFE2F44E8FA733C'));
  32. $this->assertEquals(false, $validator->validate(0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C));
  33. $this->assertEquals(true, $validator->validate(true));
  34. }
  35. }