Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPUnit\Framework\TestCase;
- use Bank\Entity\Validator;
- class ValidatorTest extends TestCase
- {
- /**
- * @expectedException InvalidArgumentException
- * @expectedMessage The value should be greater than zero
- * */
- public function testwhenTransactionValueIsLessThanZeroShouldThrowAnException()
- {
- $transaction = $this->prophesize(Transaction::class);
- $transaction->getValue()->willReturn(-10);
- $validator = new Validator();
- $validator->isValueGreaterThanZero($transaction->reveal());
- }
- }
Add Comment
Please, Sign In to add comment