PHPUnit_Framework_TestCase::assertGreaterThan PHP Метод

assertGreaterThan() публичный Метод

public assertGreaterThan ( $a, $b )
    public function assertGreaterThan($a, $b)
    {
        if ($b <= $a) {
            throw new Exception('Not greater than');
        }
    }

Usage Example

Пример #1
0
 /**
  * @Then /^I should get the rate(s)? (?<rates>([0-9 ,\.]|and)+)$/
  */
 public function iShouldGetTheRates(array $rates)
 {
     \PHPUnit_Framework_TestCase::assertGreaterThan(0, count($rates));
     reset($this->_requested_currencies);
     foreach ($rates as $expected) {
         $requested_currency = current($this->_requested_currencies);
         $Rate = null;
         if ($this->_work_day_before) {
             $Rate = $this->_NbpRepo->getRateBefore($this->_inputDate, $requested_currency);
         } else {
             $Rate = $this->_NbpRepo->getRate($this->_inputDate, $requested_currency);
         }
         \PHPUnit_Framework_TestCase::assertEquals($expected, $Rate->avg, "", 1.0E-5);
         next($this->_requested_currencies);
     }
 }