Guest User

Untitled

a guest
May 16th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. <?php
  2.  
  3. use PHPUnit\Framework\TestCase;
  4. use Bank\Entity\Validator;
  5.  
  6. class ValidatorTest extends TestCase
  7. {
  8. /**
  9. * @expectedException InvalidArgumentException
  10. * @expectedMessage The value should be greater than zero
  11. * */
  12. public function testwhenTransactionValueIsLessThanZeroShouldThrowAnException()
  13. {
  14. $transaction = $this->prophesize(Transaction::class);
  15. $transaction->getValue()->willReturn(-10);
  16.  
  17. $validator = new Validator();
  18. $validator->isValueGreaterThanZero($transaction->reveal());
  19. }
  20. }
Add Comment
Please, Sign In to add comment