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


PHP SimpleTestCompatibility::isA方法代码示例

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


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

示例1: _isTest

 function _isTest($method)
 {
     if (strtolower(substr($method, 0, 2)) == 'it' || strtolower(substr($method, 0, 6)) == 'should') {
         return !SimpleTestCompatibility::isA($this, strtolower($method));
     }
     return false;
 }
开发者ID:herlambang,项目名称:h2o-php,代码行数:7,代码来源:spec.php

示例2: _isTest

 /**
  *    Tests to see if the method is a test that should
  *    be run, override default by searching methods that starts with 'it'
  *    is a candidate unless it is the constructor.
  *    @param string $method        Method name to try.
  *    @return boolean              True if test method.
  *    @access protected
  */
 function _isTest($method)
 {
     if (strtolower(substr($method, 0, 2)) == 'it') {
         return !SimpleTestCompatibility::isA($this, strtolower($method));
     }
     return parent::_isTest($method);
 }
开发者ID:nterray,项目名称:tuleap,代码行数:15,代码来源:TuleapTestCase.class.php

示例3: testInteraceComparison

 function testInteraceComparison()
 {
     if (version_compare(phpversion(), '5', '<')) {
         return;
     }
     $object = new ComparisonClassWithInterface();
     $this->assertFalse(SimpleTestCompatibility::isA(new ComparisonClass(), 'ComparisonInterface'));
     $this->assertTrue(SimpleTestCompatibility::isA(new ComparisonClassWithInterface(), 'ComparisonInterface'));
 }
开发者ID:TomMaher,项目名称:umambo,代码行数:9,代码来源:compatibility_test.php

示例4: testIsA

 function testIsA() {
     $this->assertTrue(SimpleTestCompatibility::isA(
             new RandomCompatibilityClass(),
             'RandomCompatibilityClass'));
     $this->assertFalse(SimpleTestCompatibility::isA(
             new RandomCompatibilityClass(),
             'RandomCompatibilitySubclass'));
     $this->assertTrue(SimpleTestCompatibility::isA(
             new RandomCompatibilitySubclass(),
             'RandomCompatibilityClass'));
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:options_test.php

示例5: _addCheckbox

 /**
  *    Adds a checkbox, making it a group on a repeated name.
  *    @param SimpleCheckboxTag $tag   Incoming form control.
  *    @access private
  */
 function _addCheckbox($tag) {
     if (! isset($this->_widgets[$tag->getName()])) {
         $this->_widgets[$tag->getName()] = &$tag;
     } elseif (! SimpleTestCompatibility::isA($this->_widgets[$tag->getName()], 'SimpleCheckboxGroup')) {
         $previous = &$this->_widgets[$tag->getName()];
         $this->_widgets[$tag->getName()] = &new SimpleCheckboxGroup();
         $this->_widgets[$tag->getName()]->addWidget($previous);
         $this->_widgets[$tag->getName()]->addWidget($tag);
     } else {
         $this->_widgets[$tag->getName()]->addWidget($tag);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:17,代码来源:tag.php

示例6: _coerceExpectation

 /**
  *    Creates an equality expectation if the
  *    object/value is not already some type
  *    of expectation.
  *    @param mixed $expected      Expected value.
  *    @return SimpleExpectation   Expectation object.
  *    @access private
  */
 function _coerceExpectation($expected)
 {
     if ($expected == false) {
         return new TrueExpectation();
     }
     if (SimpleTestCompatibility::isA($expected, 'SimpleExpectation')) {
         return $expected;
     }
     return new EqualExpectation(is_string($expected) ? str_replace('%', '%%', $expected) : $expected);
 }
开发者ID:rolwi,项目名称:koala,代码行数:18,代码来源:unit_tester.php

示例7: _isTest

 /**
  *    Tests to see if the method is a test that should
  *    be run. Currently any method that starts with 'test'
  *    is a candidate unless it is the constructor.
  *    @param string $method        Method name to try.
  *    @return boolean              True if test method.
  *    @access protected
  */
 function _isTest($method) {
     if (strtolower(substr($method, 0, 4)) == 'test') {
         return ! SimpleTestCompatibility::isA($this, strtolower($method));
     }
     return false;
 }
开发者ID:nuckey,项目名称:moodle,代码行数:14,代码来源:test_case.php

示例8: array

 /**
  *   Retrieves 'preferred' objects from global pool. Class filter
  *   can be applied in order to retrieve the object of the specific
  *   class
  *   @param array|string $classes       Allowed classes or interfaces.
  *   @static
  *   @access public
  *   @return array|object|null
  *   @see prefer()
  */
 function &preferred($classes)
 {
     if (!is_array($classes)) {
         $classes = array($classes);
     }
     $registry =& SimpleTest::_getRegistry();
     for ($i = count($registry['Preferred']) - 1; $i >= 0; $i--) {
         foreach ($classes as $class) {
             if (SimpleTestCompatibility::isA($registry['Preferred'][$i], $class)) {
                 return $registry['Preferred'][$i];
             }
         }
     }
     return null;
 }
开发者ID:ljarray,项目名称:dbpedia,代码行数:25,代码来源:simpletest.php

示例9: _isConstructor

 /**
  *    Tests to see if the method is the constructor and
  *    so should be ignored.
  *    @param string $method        Method name to try.
  *    @return boolean              True if constructor.
  *    @access protected
  */
 function _isConstructor($method)
 {
     return SimpleTestCompatibility::isA($this->_test_case, strtolower($method));
 }
开发者ID:sebs,项目名称:simpletest,代码行数:11,代码来源:runner.php

示例10: test

 /**
  *    Tests the expectation. True if the type or
  *    class matches the string value.
  *    @param string $compare        Comparison value.
  *    @return boolean               True if correct.
  *    @access public
  */
 function test($compare)
 {
     if (is_object($compare)) {
         return SimpleTestCompatibility::isA($compare, $this->type);
     } else {
         $function = 'is_' . $this->canonicalType($this->type);
         if (is_callable($function)) {
             return $function($compare);
         }
         return false;
     }
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:19,代码来源:expectation.php

示例11: _isTest

 /**
  * IsTest method
  *
  * Prevent intensive W3 test, and the build tests (used to generate the testSection tests) unless
  * explicitly specified
  *
  * @param mixed $method
  * @return void
  */
 protected function _isTest($method)
 {
     if (strtolower($method) === 'testaction') {
         return false;
     }
     $buildTests = ['testw3validity', 'testbuildregex', 'testbuildtest'];
     if (in_array(strtolower($method), $buildTests)) {
         return !$this->skipSetupTests;
     }
     if (strtolower(substr($method, 0, 4)) === 'test') {
         if (!$this->skipSetupTests) {
             return false;
         }
         return !SimpleTestCompatibility::isA($this, strtolower($method));
     }
     return false;
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:26,代码来源:SluggedBehaviorTest.php

示例12: testIsA

 function testIsA()
 {
     $this->assertTrue(SimpleTestCompatibility::isA(new ComparisonClass(), 'ComparisonClass'));
     $this->assertFalse(SimpleTestCompatibility::isA(new ComparisonClass(), 'ComparisonSubclass'));
     $this->assertTrue(SimpleTestCompatibility::isA(new ComparisonSubclass(), 'ComparisonClass'));
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:6,代码来源:options_test.php

示例13: testInteraceComparison

 function testInteraceComparison()
 {
     $object = new ComparisonClassWithInterface();
     $this->assertFalse(SimpleTestCompatibility::isA(new ComparisonClass(), 'ComparisonInterface'));
     $this->assertTrue(SimpleTestCompatibility::isA(new ComparisonClassWithInterface(), 'ComparisonInterface'));
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:6,代码来源:compatibility_test.php

示例14: test

 /**
  *    Tests the expectation. True if the type or
  *    class matches the string value.
  *    @param string $compare        Comparison value.
  *    @return boolean               True if correct.
  *    @access public
  */
 function test($compare)
 {
     if (is_object($compare)) {
         return SimpleTestCompatibility::isA($compare, $this->_type);
     } else {
         return strtolower(gettype($compare)) == $this->_canonicalType($this->_type);
     }
 }
开发者ID:clickdimension,项目名称:tinybutstrong,代码行数:15,代码来源:expectation.php

示例15: _coerceToExpectation

 /**
  *    Creates an equality expectation if the
  *    object/value is not already some type
  *    of expectation.
  *    @param mixed $expected      Expected value.
  *    @return SimpleExpectation   Expectation object.
  *    @access private
  */
 function _coerceToExpectation($expected)
 {
     if (SimpleTestCompatibility::isA($expected, 'SimpleExpectation')) {
         return $expected;
     }
     return new EqualExpectation($expected);
 }
开发者ID:TomMaher,项目名称:umambo,代码行数:15,代码来源:unit_tester.php


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