當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。