本文整理汇总了PHP中PHPUnit_Framework_Error_Notice::enabled方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Error_Notice::enabled方法的具体用法?PHP PHPUnit_Framework_Error_Notice::enabled怎么用?PHP PHPUnit_Framework_Error_Notice::enabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Error_Notice
的用法示例。
在下文中一共展示了PHPUnit_Framework_Error_Notice::enabled方法的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;
}
示例2: testSimpleInvocationError
public function testSimpleInvocationError()
{
\PHPUnit_Framework_Error_Notice::$enabled = FALSE;
$this->object->setCallable(array('SimplyNot', 'callable'));
$this->setExpectedException('\\Fwk\\Di\\Exceptions\\InvalidCallableDefinitionException');
$this->object->invoke($this->getContainer());
}
示例3: testLoadVendorDatabaseBadMask
public function testLoadVendorDatabaseBadMask()
{
// Disable PHPUnit's error handler which would stop execution upon the
// first error.
\PHPUnit_Framework_Error_Notice::$enabled = false;
// Disable all console error output
$displayErrors = ini_get('display_errors');
$logErrors = ini_get('log_errors');
ini_set('display_errors', false);
ini_set('log_errors', false);
if (extension_loaded('xdebug')) {
xdebug_disable();
}
// Invoke the tested method
$input = array("13/37\tshort7", "00:00:5E:00:53:00\tshort");
MacAddress::loadVendorDatabase($input);
// Restore error handling
\PHPUnit_Framework_Error_Notice::$enabled = true;
if (ini_get('xdebug.default_enable')) {
xdebug_enable();
}
ini_set('display_errors', $displayErrors);
ini_set('log_errors', $logErrors);
// Test the generated error
$lastError = error_get_last();
$this->assertEquals(E_USER_NOTICE, $lastError['type']);
$this->assertEquals('Ignoring MAC address 13/37 because mask is not a multiple of 4.', $lastError['message']);
// Parsing should continue after error.
$expected = array(array('address' => '00005E005300', 'length' => 12, 'vendor' => 'short'));
$reflectionClass = new \ReflectionClass('Library\\MacAddress');
$this->assertEquals($expected, $reflectionClass->getStaticProperties()['_vendorList']);
}
示例4: setUp
public function setUp()
{
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
parent::setUp();
$this->ProductCredit = ClassRegistry::init('ProductCredit');
//$this->OrdersController->startup($this->Controller);
}
示例5: testSendPacket
public function testSendPacket()
{
\PHPUnit_Framework_Error_Notice::$enabled = FALSE;
$packet = $this->getMockBuilder('\\SteamCondenser\\Servers\\Packets\\SteamPacket')->disableOriginalConstructor()->getMock();
$packet->expects($this->once())->method('__toString')->will($this->returnValue('test'));
$this->udpSocket->expects($this->once())->method('send')->with('test');
$this->socket->send($packet);
}
示例6: 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;
}
示例7: 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;
}
示例8: setUp
public function setUp()
{
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
parent::setUp();
$CakeRequest = new CakeRequest();
$CakeResponse = new CakeResponse();
$this->Controller = new TestController($CakeRequest, $CakeResponse);
$Collection = new ComponentCollection();
$this->PromotionController = new PromotionController($Collection);
}
示例9: setUp
public function setUp()
{
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
parent::setUp();
$CakeRequest = new CakeRequest();
$CakeResponse = new CakeResponse();
$this->Controller = new TestController($CakeRequest, $CakeResponse);
$Collection = new ComponentCollection();
$this->PartyCreateController = new PartyController($Collection);
$this->Party = ClassRegistry::init('Party');
}
示例10: 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;
}
示例11: setUp
public function setUp()
{
parent::setUp();
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
$CakeRequest = new CakeRequest();
$CakeResponse = new CakeResponse();
$this->Controller = new TestController($CakeRequest, $CakeResponse);
$Collection = new ComponentCollection();
$this->Payment = new PaymentComponent($Collection);
$this->Payment->startup($this->Controller);
}
示例12: setUp
public function setUp()
{
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
parent::setUp();
$CakeRequest = new CakeRequest();
$CakeResponse = new CakeResponse();
$this->Controller = new TestController($CakeRequest, $CakeResponse);
$Collection = new ComponentCollection();
$this->ShoppingcartController = new ShoppingcartController($Collection);
$this->ShoppingCartItem = ClassRegistry::init('ShoppingCartItem');
}
示例13: setUp
public function setUp()
{
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
parent::setUp();
$CakeRequest = new CakeRequest();
$CakeResponse = new CakeResponse();
$this->Controller = new TestController($CakeRequest, $CakeResponse);
$Collection = new ComponentCollection();
$this->PresenterController = new PresenterController($Collection);
$this->RoyaltiesEarned = ClassRegistry::init('RoyaltiesEarned');
//$this->OrdersController->startup($this->Controller);
}
示例14: setUp
public function setUp()
{
PHPUnit_Framework_Error_Notice::$enabled = FALSE;
parent::setUp();
$CakeRequest = new CakeRequest();
$CakeResponse = new CakeResponse();
$this->Controller = new TestController($CakeRequest, $CakeResponse);
$Collection = new ComponentCollection();
$this->AppController = new AppController($Collection);
$this->TestController = new TestTwoController($collection);
//$this->OrdersController->startup($this->Controller);
}
示例15: wrapException
function wrapException($cb, $type = NULL, $code = NULL)
{
PHPUnit_Framework_Error_Notice::$enabled = false;
$exOut = NULL;
try {
$cb();
} catch (Exception $ex) {
$exOut = $ex;
}
PHPUnit_Framework_Error_Notice::$enabled = true;
if ($type !== NULL) {
$this->assertErrorType($type, $exOut);
}
if ($code !== NULL) {
$this->assertErrorCode($code, $exOut);
}
return $exOut;
}