当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleTestCase::assert方法代码示例

本文整理汇总了PHP中SimpleTestCase::assert方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleTestCase::assert方法的具体用法?PHP SimpleTestCase::assert怎么用?PHP SimpleTestCase::assert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleTestCase的用法示例。


在下文中一共展示了SimpleTestCase::assert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assertType

 /**
  *    Tests the type of a value.
  *    @param $value          Value to take type of.
  *    @param $type           Hoped for type.
  *    @param $message        Message to display.
  *    @public
  */
 function assertType($value, $type, $message = "%s")
 {
     parent::assert(new TrueExpectation(), gettype($value) == strtolower($type), $message);
 }
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:11,代码来源:pear_test_case.php

示例2: atTestEnd

 /**
  *    Receives event from unit test that the current
  *    test method has finished. Totals up the call
  *    counts and triggers a test assertion if a test
  *    is present for expected call counts.
  *    @param string $test_method      Current method name.
  *    @param SimpleTestCase $test     Test to send message to.
  *    @access public
  */
 function atTestEnd($test_method, &$test)
 {
     foreach ($this->_expected_counts as $method => $expectation) {
         $test->assert($expectation, $this->getCallCount($method));
     }
     foreach ($this->_max_counts as $method => $expectation) {
         if ($expectation->test($this->getCallCount($method))) {
             $test->assert($expectation, $this->getCallCount($method));
         }
     }
 }
开发者ID:ljarray,项目名称:dbpedia,代码行数:20,代码来源:mock_objects.php

示例3: isExpected

 /**
  *    Compares the expected exception with any
  *    in the queue. Issues a pass or fail and
  *    returns the state of the test.
  *    @param SimpleTestCase $test    Test case to send messages to.
  *    @param Exception $exception    Exception to compare.
  *    @return boolean                False on no match.
  */
 function isExpected($test, $exception)
 {
     if ($this->expected) {
         return $test->assert($this->expected, $exception, $this->message);
     }
     foreach ($this->ignored as $ignored) {
         if ($ignored->test($exception)) {
             return true;
         }
     }
     return false;
 }
开发者ID:continuousphptest,项目名称:workflow.test,代码行数:20,代码来源:exceptions.php

示例4: isExpected

 /**
  *    Compares the expected exception with any
  *    in the queue. Issues a pass or fail and
  *    returns the state of the test.
  *    @param SimpleTestCase $test    Test case to send messages to.
  *    @param Exception $exception    Exception to compare.
  *    @return boolean                False on no match.
  */
 function isExpected($test, $exception)
 {
     if ($this->expected) {
         return $test->assert($this->expected, $exception, $this->message);
     }
     return false;
 }
开发者ID:clickdimension,项目名称:tinybutstrong,代码行数:15,代码来源:exceptions.php

示例5: assertRegexp

 /**
  *    Tests a regex match.
  *    @param $pattern        Regex to match.
  *    @param $subject        String to search in.
  *    @param $message        Message to display.
  *    @public
  */
 function assertRegexp($pattern, $subject, $message = false)
 {
     parent::assert(new PatternExpectation($pattern), $subject, $message);
 }
开发者ID:muhamadsyahril,项目名称:codeigniter-simpletest,代码行数:11,代码来源:phpunit_test_case.php


注:本文中的SimpleTestCase::assert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。