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


PHP PHPUnit_Framework_Error_Warning类代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     unset($this->app);
     PHPUnit_Framework_Error_Warning::$enabled = $this->warning_enabled;
     PHPUnit_Framework_Error_Notice::$enabled = $this->notice_enabled;
     PHPUnit_Framework_Error_Deprecated::$enabled = $this->deprecated_enabled;
 }
开发者ID:loopsframework,项目名称:base,代码行数:7,代码来源:LoopsTestCase.php

示例2: testProcessOrderLedgerPayments

 public function testProcessOrderLedgerPayments()
 {
     PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     $result = $this->Payment->processOrderPayments("Test Order #13123", array(array("type" => "ledger", "presenter_id" => 1, "user_id" => 1, "amount" => Money::fromFloat(60)), array("type" => "creditcard", "amount" => Money::fromFloat(30), "cardholder" => "Test wohoo", "billingzip" => "84003", "cardnum" => "4068758923310472", "carexp" => "12/2015", "cardcode" => "962")));
     $this->assertTrue($result['success']);
     $this->assertTrue(!empty($result['payments'][0]['transaction_id']) && strlen($result['payments'][0]['transaction_id']) == 17);
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:7,代码来源:PaymentComponentTest.php

示例3: doEnhancedRun

 public function doEnhancedRun(\PHPUnit_Framework_Test $suite, \PHPUnit_Framework_TestResult $result, array $arguments = array())
 {
     $this->handleConfiguration($arguments);
     if (is_integer($arguments['repeat'])) {
         $suite = new \PHPUnit_Extensions_RepeatedTest($suite, $arguments['repeat'], $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     }
     if (!$arguments['convertErrorsToExceptions']) {
         $result->convertErrorsToExceptions(FALSE);
     }
     if (!$arguments['convertNoticesToExceptions']) {
         \PHPUnit_Framework_Error_Notice::$enabled = FALSE;
     }
     if (!$arguments['convertWarningsToExceptions']) {
         \PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     }
     if ($arguments['stopOnError']) {
         $result->stopOnError(TRUE);
     }
     if ($arguments['stopOnFailure']) {
         $result->stopOnFailure(TRUE);
     }
     if ($arguments['stopOnIncomplete']) {
         $result->stopOnIncomplete(TRUE);
     }
     if ($arguments['stopOnSkipped']) {
         $result->stopOnSkipped(TRUE);
     }
     if ($this->printer === NULL) {
         if (isset($arguments['printer']) && $arguments['printer'] instanceof \PHPUnit_Util_Printer) {
             $this->printer = $arguments['printer'];
         } else {
             $this->printer = new \Codeception\PHPUnit\ResultPrinter\UI(NULL, $arguments['verbose'], $arguments['colors'], $arguments['debug']);
         }
     }
     if (isset($arguments['report'])) {
         if ($arguments['report']) {
             $this->printer = new \Codeception\PHPUnit\ResultPrinter\Report();
         }
     }
     if (isset($arguments['html'])) {
         if ($arguments['html']) {
             $arguments['listeners'][] = new \Codeception\PHPUnit\ResultPrinter\HTML($arguments['html']);
         }
     }
     $arguments['listeners'][] = $this->printer;
     // clean up listeners between suites
     foreach ($arguments['listeners'] as $listener) {
         $result->removeListener($listener);
         $result->addListener($listener);
     }
     if ($arguments['strict']) {
         $result->strictMode(TRUE);
     }
     $suite->run($result, $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     unset($suite);
     $result->flushListeners();
     return $result;
 }
开发者ID:nike-17,项目名称:Codeception,代码行数:58,代码来源:Runner.php

示例4: setUp

 /**
  * Set up method
  */
 protected function setUp()
 {
     $this->corporateDirectoryWebServiceWrapper = new CorporateDirectoryWebServiceWrapper();
     $this->fixture = sfConfig::get('sf_plugins_dir') . '/orangehrmCorporateDirectoryPlugin/test/fixtures/EmployeeDirectoryWrapperData.yml';
     $this->manager = new WSManager();
     $this->helper = new WSHelper();
     PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     PHPUnit_Framework_Error_Notice::$enabled = FALSE;
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:12,代码来源:CorporateDirectoryWebServiceWrapperTest.php

示例5: go_forth

 private function go_forth()
 {
     if (defined('HHVM_VERSION')) {
         return;
     }
     PHPUnit_Framework_Error_Warning::$enabled = $this->silence_warning;
     ini_set('display_errors', $this->silence_display);
     ini_set('error_log', $this->silence_log);
 }
开发者ID:reekris,项目名称:user-switching,代码行数:9,代码来源:user-switching-test.php

示例6: runBare

 /**
  * Injects an untainted clone of the object manager and all its referencing
  * objects for every test.
  *
  * @return void
  * @author Robert Lemke <robert@typo3.org>
  */
 public function runBare()
 {
     \PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     if (class_exists('F3\\Testing\\AbstractTestRunner', FALSE)) {
         $this->objectManager = clone \F3\Testing\AbstractTestRunner::$objectManagerForTesting;
         $this->objectFactory = $this->objectManager->getObjectFactory();
     }
     parent::runBare();
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:16,代码来源:BaseTestCase.php

示例7: testBadCall

 public function testBadCall()
 {
     PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     $url =& $this->obj;
     $meth_name = md5(time());
     $this->setExpectedException('PHPUnit_Framework_Error');
     $url->{$meth_name}('test');
     PHPUnit_Framework_Error_Warning::$enabled = TRUE;
 }
开发者ID:killsaw,项目名称:f3-plugins,代码行数:9,代码来源:url_test.php

示例8: tearDown

 public function tearDown()
 {
     // If file has been renamed, restore it at original place
     if ( file_exists( $this->destFile ) )
         rename( $this->destFile, $this->file );
     // If file has been removed, restore it as well
     if ( !file_exists( $this->file ) )
         file_put_contents ( $this->file, $this->content );
     PHPUnit_Framework_Error_Warning::$enabled = $this->warningEnabledOrig;
     parent::tearDown();
 }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:11,代码来源:ezfilerename_test.php

示例9: setUp

 /**
  * Set up method
  */
 protected function setUp()
 {
     $this->adminWebServiceWrapper = new AdminWebServiceWrapper();
     $this->jobTitlefixture = sfConfig::get('sf_plugins_dir') . '/orangehrmAdminPlugin/test/fixtures/JobTitleDao.yml';
     $this->locationFixture = sfConfig::get('sf_plugins_dir') . '/orangehrmAdminPlugin/test/fixtures/LocationDao.yml';
     $this->locationTestCases = sfYaml::load(sfConfig::get('sf_plugins_dir') . '/orangehrmAdminPlugin/test/fixtures/LocationDao.yml');
     $this->manager = new WSManager();
     $this->helper = new WSHelper();
     PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     PHPUnit_Framework_Error_Notice::$enabled = FALSE;
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:14,代码来源:AdminWebServiceWrapperTest.php

示例10: testCleanFailure

 /**
  * @expectedException \Exception
  * @expectedExceptionMessageRegexp /Unable to load the file contents of/
  */
 public function testCleanFailure()
 {
     \PHPUnit_Framework_Error_Warning::$enabled = false;
     $err_level = error_reporting();
     error_reporting($err_level & ~E_WARNING);
     $fake_sugar = __DIR__ . '/fake_sugar';
     touch(self::$invalid_file);
     chmod(self::$invalid_file, 00);
     $logger = new TestLogger();
     $cleaner = new LangFileCleaner(new Application($logger, $fake_sugar));
     $this->assertTrue($cleaner->clean());
     error_reporting($err_level);
 }
开发者ID:inetprocess,项目名称:libsugarcrm,代码行数:17,代码来源:LangFileCleanerTest.php

示例11: testOnAfterBuildQuery

 /**
  * @group           Behaviour
  * @group           RelationFiltersOnAfterBuildQuery
  * @covers          FOF30\Model\DataModel\Behaviour\RelationFilters::onAfterBuildQuery
  * @dataProvider    RelationFiltersDataprovider::getTestOnAfterBuildQuery
  */
 public function testOnAfterBuildQuery($test, $check)
 {
     \PHPUnit_Framework_Error_Warning::$enabled = false;
     $msg = 'RelationFilters::onAfterBuildQuery %s - Case: ' . $check['case'];
     $config = array('relations' => array(array('itemName' => 'children', 'type' => 'hasMany', 'foreignModelClass' => 'Children', 'localKey' => 'fakeapp_parent_id', 'foreignKey' => 'fakeapp_parent_id')));
     /** @var \FOF30\Model\DataModel $model */
     $model = new Parents(static::$container, $config);
     $query = \JFactory::getDbo()->getQuery(true)->select('*')->from('test');
     $dispatcher = $model->getBehavioursDispatcher();
     $filter = new RelationFilters($dispatcher);
     // I have to setup a filter
     $model->has('children', $test['operator'], $test['value']);
     $filter->onAfterBuildQuery($model, $query);
     $this->assertEquals($check['query'], trim((string) $query), sprintf($msg, 'Failed to build the search query'));
 }
开发者ID:Joal01,项目名称:fof,代码行数:21,代码来源:RelationFiltersTest.php

示例12: setExpectedTriggerError

 public function setExpectedTriggerError($errno, $message = '')
 {
     $exceptionName = '';
     switch ($errno) {
         case E_NOTICE:
         case E_STRICT:
             PHPUnit_Framework_Error_Notice::$enabled = true;
             $exceptionName = 'PHPUnit_Framework_Error_Notice';
             break;
         case E_WARNING:
             PHPUnit_Framework_Error_Warning::$enabled = true;
             $exceptionName = 'PHPUnit_Framework_Error_Warning';
             break;
         default:
             $exceptionName = 'PHPUnit_Framework_Error';
             break;
     }
     $this->expectedTriggerError = true;
     $this->test_case->setExpectedException($exceptionName, (string) $message, $errno);
 }
开发者ID:phpbb,项目名称:phpbb,代码行数:20,代码来源:phpbb_test_case_helpers.php

示例13: runBare

 /**
  * @return void
  */
 public function runBare()
 {
     \PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     parent::runBare();
 }
开发者ID:animaltool,项目名称:webinterface,代码行数:8,代码来源:BaseTestCase.php

示例14: doEnhancedRun

 public function doEnhancedRun(\PHPUnit_Framework_Test $suite, \PHPUnit_Framework_TestResult $result, array $arguments = array())
 {
     $this->handleConfiguration($arguments);
     if (is_integer($arguments['repeat'])) {
         $suite = new \PHPUnit_Extensions_RepeatedTest($suite, $arguments['repeat'], $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     }
     $result->convertErrorsToExceptions(FALSE);
     if (!$arguments['convertNoticesToExceptions']) {
         \PHPUnit_Framework_Error_Notice::$enabled = FALSE;
     }
     if (!$arguments['convertWarningsToExceptions']) {
         \PHPUnit_Framework_Error_Warning::$enabled = FALSE;
     }
     if ($arguments['stopOnError']) {
         $result->stopOnError(TRUE);
     }
     if ($arguments['stopOnFailure']) {
         $result->stopOnFailure(TRUE);
     }
     if ($arguments['stopOnIncomplete']) {
         $result->stopOnIncomplete(TRUE);
     }
     if ($arguments['stopOnSkipped']) {
         $result->stopOnSkipped(TRUE);
     }
     if ($this->printer === NULL) {
         if (isset($arguments['printer']) && $arguments['printer'] instanceof \PHPUnit_Util_Printer) {
             $this->printer = $arguments['printer'];
         } else {
             $this->printer = new \Codeception\PHPUnit\ResultPrinter\UI(NULL, $arguments['verbose'], $arguments['colors'], $arguments['debug']);
         }
     }
     if (isset($arguments['report'])) {
         if ($arguments['report']) {
             $this->printer = new \Codeception\PHPUnit\ResultPrinter\Report();
         }
     }
     if (empty(self::$persistentListeners)) {
         foreach ($this->defaultListeners as $listener => $value) {
             if (!isset($arguments[$listener])) {
                 $arguments[$listener] = $value;
             }
         }
         if ($arguments['html']) {
             self::$persistentListeners[] = new \Codeception\PHPUnit\ResultPrinter\HTML(\Codeception\Configuration::logDir() . 'report.html');
         }
         if ($arguments['xml']) {
             self::$persistentListeners[] = new \Codeception\PHPUnit\Log\JUnit(\Codeception\Configuration::logDir() . 'report.xml', false);
         }
         if ($arguments['tap']) {
             self::$persistentListeners[] = new \PHPUnit_Util_Log_TAP(\Codeception\Configuration::logDir() . 'report.tap.log');
         }
         if ($arguments['json']) {
             self::$persistentListeners[] = new \PHPUnit_Util_Log_JSON(\Codeception\Configuration::logDir() . 'report.json');
         }
         foreach (self::$persistentListeners as $listener) {
             $result->addListener($listener);
         }
     }
     $arguments['listeners'][] = $this->printer;
     // clean up listeners between suites
     foreach ($arguments['listeners'] as $listener) {
         $result->addListener($listener);
     }
     if ($arguments['strict']) {
         $result->strictMode(TRUE);
     }
     $suite->run($result, $arguments['filter'], $arguments['groups'], $arguments['excludeGroups'], $arguments['processIsolation']);
     unset($suite);
     foreach ($arguments['listeners'] as $listener) {
         $result->removeListener($listener);
     }
     return $result;
 }
开发者ID:pfz,项目名称:codeception,代码行数:74,代码来源:Runner.php

示例15: doRun

 /**
  * @param PHPUnit_Framework_Test $suite
  * @param array                  $arguments
  * @param bool                   $exit
  *
  * @return PHPUnit_Framework_TestResult
  */
 public function doRun(PHPUnit_Framework_Test $suite, array $arguments = [], $exit)
 {
     if (isset($arguments['configuration'])) {
         $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] = $arguments['configuration'];
     }
     $this->handleConfiguration($arguments);
     $this->processSuiteFilters($suite, $arguments);
     if (isset($arguments['bootstrap'])) {
         $GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap'];
     }
     if ($arguments['backupGlobals'] === false) {
         $suite->setBackupGlobals(false);
     }
     if ($arguments['backupStaticAttributes'] === true) {
         $suite->setBackupStaticAttributes(true);
     }
     if ($arguments['beStrictAboutChangesToGlobalState'] === true) {
         $suite->setbeStrictAboutChangesToGlobalState(true);
     }
     if (is_integer($arguments['repeat'])) {
         $test = new PHPUnit_Extensions_RepeatedTest($suite, $arguments['repeat'], $arguments['processIsolation']);
         $suite = new PHPUnit_Framework_TestSuite();
         $suite->addTest($test);
     }
     $result = $this->createTestResult();
     if (!$arguments['convertErrorsToExceptions']) {
         $result->convertErrorsToExceptions(false);
     }
     if (!$arguments['convertNoticesToExceptions']) {
         PHPUnit_Framework_Error_Notice::$enabled = false;
     }
     if (!$arguments['convertWarningsToExceptions']) {
         PHPUnit_Framework_Error_Warning::$enabled = false;
     }
     if ($arguments['stopOnError']) {
         $result->stopOnError(true);
     }
     if ($arguments['stopOnFailure']) {
         $result->stopOnFailure(true);
     }
     if ($arguments['stopOnWarning']) {
         $result->stopOnWarning(true);
     }
     if ($arguments['stopOnIncomplete']) {
         $result->stopOnIncomplete(true);
     }
     if ($arguments['stopOnRisky']) {
         $result->stopOnRisky(true);
     }
     if ($arguments['stopOnSkipped']) {
         $result->stopOnSkipped(true);
     }
     if ($this->printer === null) {
         if (isset($arguments['printer']) && $arguments['printer'] instanceof PHPUnit_Util_Printer) {
             $this->printer = $arguments['printer'];
         } else {
             $printerClass = 'PHPUnit_TextUI_ResultPrinter';
             if (isset($arguments['printer']) && is_string($arguments['printer']) && class_exists($arguments['printer'], false)) {
                 $class = new ReflectionClass($arguments['printer']);
                 if ($class->isSubclassOf('PHPUnit_TextUI_ResultPrinter')) {
                     $printerClass = $arguments['printer'];
                 }
             }
             $this->printer = new $printerClass(isset($arguments['stderr']) ? 'php://stderr' : null, $arguments['verbose'], $arguments['colors'], $arguments['debug'], $arguments['columns'], $arguments['reverseList']);
         }
     }
     if (!$this->printer instanceof PHPUnit_Util_Log_TAP) {
         $this->printer->write(PHPUnit_Runner_Version::getVersionString() . "\n");
         self::$versionStringPrinted = true;
         if ($arguments['verbose']) {
             $runtime = $this->runtime->getNameWithVersion();
             if ($this->runtime->hasXdebug()) {
                 $runtime .= sprintf(' with Xdebug %s', phpversion('xdebug'));
             }
             $this->writeMessage('Runtime', $runtime);
             if (isset($arguments['configuration'])) {
                 $this->writeMessage('Configuration', $arguments['configuration']->getFilename());
             }
         }
         if (isset($arguments['deprecatedCheckForUnintentionallyCoveredCodeSettingUsed'])) {
             print "Warning:       Deprecated configuration setting \"checkForUnintentionallyCoveredCode\" used\n";
         }
     }
     foreach ($arguments['listeners'] as $listener) {
         $result->addListener($listener);
     }
     $result->addListener($this->printer);
     if (isset($arguments['testdoxHTMLFile'])) {
         $result->addListener(new PHPUnit_Util_TestDox_ResultPrinter_HTML($arguments['testdoxHTMLFile']));
     }
     if (isset($arguments['testdoxTextFile'])) {
         $result->addListener(new PHPUnit_Util_TestDox_ResultPrinter_Text($arguments['testdoxTextFile']));
     }
//.........这里部分代码省略.........
开发者ID:tknplt,项目名称:phpunit,代码行数:101,代码来源:TestRunner.php


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