daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest May 16th, 2018 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top