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


PHP PHPUnit_Framework_MockObject_MockObject::process方法代码示例

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


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

示例1: processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface

 /**
  * @test
  */
 public function processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface()
 {
     $typoScript = array(10 => $this->getUniqueId('postprocess'), 20 => \TYPO3\CMS\Form\Tests\Unit\Fixtures\PostProcessorWithoutInterfaceFixture::class);
     $this->subject->typoScript = $typoScript;
     $this->subject->expects($this->once())->method('sortTypoScriptKeyList')->will($this->returnValue(array(10, 20)));
     $returnValue = $this->subject->process();
     $this->assertEquals('', $returnValue);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:11,代码来源:PostProcessorTest.php

示例2: processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface

 /**
  * @test
  */
 public function processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface()
 {
     $classNameWithoutInterface = uniqid('postprocess');
     eval('namespace TYPO3\\CMS\\Form\\PostProcess;' . 'class ' . $classNameWithoutInterface . 'PostProcessor {' . '  public function __construct(\\TYPO3\\CMS\\Form\\Domain\\Model\\Form $form, array $typoScript) {' . '  }' . '  public function process() {' . '    return \'withoutInterface\';' . '  }' . '}');
     $typoScript = array(10 => uniqid('postprocess'), 20 => $classNameWithoutInterface);
     $this->fixture->typoScript = $typoScript;
     $this->fixture->expects($this->once())->method('sortTypoScriptKeyList')->will($this->returnValue(array(10, 20)));
     $returnValue = $this->fixture->process();
     $this->assertEquals('', $returnValue);
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:13,代码来源:PostProcessorTest.php

示例3: processWrapsCurrentViewHelperInEscapeNode

 /**
  * @test
  */
 public function processWrapsCurrentViewHelperInEscapeNode()
 {
     $interceptorPosition = InterceptorInterface::INTERCEPT_OBJECTACCESSOR;
     $mockNode = $this->getMock(ObjectAccessorNode::class, [], [], '', false);
     $actualResult = $this->escapeInterceptor->process($mockNode, $interceptorPosition, $this->mockParsingState);
     $this->assertInstanceOf(EscapingNode::class, $actualResult);
 }
开发者ID:typo3,项目名称:fluid,代码行数:10,代码来源:EscapeTest.php

示例4: testProcess

 /**
  * @covers ::process
  * @covers ::processCallback
  */
 public function testProcess()
 {
     $cache_contexts = Cache::mergeContexts(['baz', 'qux']);
     $cache_tags = Cache::mergeTags(['foo', 'bar']);
     $currency_code_from = 'EUR';
     $currency_code_to = 'NLG';
     $rate = '2.20371';
     $exchange_rate_provider_id = 'foo_bar';
     $exchange_rate = new ExchangeRate($currency_code_from, $currency_code_to, $rate, $exchange_rate_provider_id);
     $exchange_rate->addCacheContexts($cache_contexts);
     $exchange_rate->addCacheTags($cache_tags);
     $this->input->expects($this->any())->method('parseAmount')->will($this->returnArgument(0));
     $this->exchangeRateProvider->expects($this->any())->method('load')->with($currency_code_from, $currency_code_to)->willReturn($exchange_rate);
     $langcode = $this->randomMachineName(2);
     $tokens_valid = ['[currency:EUR:NLG]' => '2.20371', '[currency:EUR:NLG:1]' => '2.20371', '[currency:EUR:NLG:2]' => '4.40742'];
     $tokens_invalid = ['[currency]', '[currency:]', '[currency::]', '[currency:EUR]', '[currency:EUR:123]', '[currency:123:EUR]', '[currency:123]'];
     foreach ($tokens_valid as $token => $replacement) {
         $result = $this->sut->process($token, $langcode);
         $this->assertInstanceOf(FilterProcessResult::class, $result);
         $this->assertSame($replacement, $result->getProcessedText());
         $this->assertSame($cache_contexts, $result->getCacheContexts());
         $this->assertSame($cache_tags, $result->getCacheTags());
     }
     foreach ($tokens_invalid as $token) {
         $result = $this->sut->process($token, $langcode);
         $this->assertInstanceOf(FilterProcessResult::class, $result);
         $this->assertSame($token, $result->getProcessedText());
         $this->assertEmpty($result->getCacheContexts());
         $this->assertEmpty($result->getCacheTags());
     }
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:35,代码来源:CurrencyExchangeTest.php

示例5: processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface

 /**
  * @test
  */
 public function processReturnsEmptyStringIfSpecifiedPostProcessorDoesNotImplementTheInterface()
 {
     $typoScript = array(10 => uniqid('postprocess'), 20 => $this->classNameWithoutInterface);
     $this->postprocessor->typoScript = $typoScript;
     $this->postprocessor->expects($this->once())->method('sortTypoScriptKeyList')->will($this->returnValue(array(10, 20)));
     $returnValue = $this->postprocessor->process();
     $this->assertEquals('', $returnValue);
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:11,代码来源:PostProcessorTest.php

示例6: processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor

 /**
  * @test
  */
 public function processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor()
 {
     $interceptorPosition = InterceptorInterface::INTERCEPT_OBJECTACCESSOR;
     $mockNode = $this->getMock('NamelessCoder\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array(), array(), '', FALSE);
     $mockEscapeViewHelper = $this->getMock('NamelessCoder\\Fluid\\ViewHelpers\\Format\\HtmlspecialcharsViewHelper');
     $actualResult = $this->escapeInterceptor->process($mockNode, $interceptorPosition, $this->mockParsingState);
     $this->assertInstanceOf('NamelessCoder\\Fluid\\Core\\Parser\\SyntaxTree\\ViewHelperNode', $actualResult);
 }
开发者ID:bwaidelich,项目名称:TYPO3.Fluid,代码行数:11,代码来源:EscapeTest.php

示例7: testProcess

 public function testProcess()
 {
     $item = $this->getMock('Mage_Sales_Model_Quote_Item', array('getAddress'), array(), '', false);
     $item->expects($this->once())->method('getAddress')->will($this->returnValue(true));
     $item->setDiscountCalculationPrice(-1);
     $item->setCalculationPrice(1);
     $quote = $this->getMock('Mage_Sales_Model_Quote', null, array(), '', false);
     $item->setQuote($quote);
     $this->assertInstanceOf('Mage_SalesRule_Model_Validator', $this->_model->process($item));
     return true;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:11,代码来源:ValidatorTest.php

示例8: processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor

 /**
  * @test
  */
 public function processWrapsCurrentViewHelperInHtmlspecialcharsViewHelperOnObjectAccessor()
 {
     $interceptorPosition = InterceptorInterface::INTERCEPT_OBJECTACCESSOR;
     $mockNode = $this->getMock(\TYPO3\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, array(), array(), '', false);
     $mockEscapeViewHelper = $this->getMock(\TYPO3\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class);
     $mockObjectManager = $this->getMock(\TYPO3\Flow\Object\ObjectManagerInterface::class);
     $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::class)->will($this->returnValue($mockEscapeViewHelper));
     $mockObjectManager->expects($this->at(1))->method('get')->with(\TYPO3\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, $mockEscapeViewHelper, array('value' => $mockNode))->will($this->returnValue($this->mockNode));
     $this->escapeInterceptor->injectObjectManager($mockObjectManager);
     $actualResult = $this->escapeInterceptor->process($mockNode, $interceptorPosition, $this->mockParsingState);
     $this->assertSame($this->mockNode, $actualResult);
 }
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:15,代码来源:EscapeTest.php

示例9: testVerifyProcessingSkipped

 /**
  * Verifies that we can skip processing.
  *
  * @covers ::dispatchSkippedProcessing
  * @covers ::process
  *
  * @depends testVerifyFileContentsProcessedAndEventsDispatched
  */
 public function testVerifyProcessingSkipped()
 {
     // register an event dispatcher
     $dispatcher = new EventDispatcher();
     $this->processor->setDispatcher($dispatcher);
     // require that processing be skipped
     $dispatcher->addListener(Events::PRE_PROCESSING, function (PreProcessingEvent $event) {
         $event->skip();
     });
     // verify that the skip event is dispatched
     $skipped = false;
     $dispatcher->addListener(Events::SKIPPED_PROCESSING, function (SkippedProcessingEvent $event) use(&$skipped) {
         $skipped = true;
     });
     // make sure the processing method is never called
     $this->processor->expects(self::never())->method('doProcessing');
     // make sure the contents were are returned unchanged
     self::assertEquals('<?php echo "Hello, world!\\n";', $this->processor->process('test.php', '<?php echo "Hello, world!\\n";'));
     // make sure the skip event was dispatched
     self::assertTrue($skipped);
 }
开发者ID:box-project,项目名称:processor,代码行数:29,代码来源:AbstractProcessorTest.php

示例10: testWritePermissionErrors

 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Missing write permissions to the following paths:
  */
 public function testWritePermissionErrors()
 {
     $this->filePermissions->expects($this->once())->method('getMissingWritablePathsForInstallation')->willReturn(['/a/ro/dir', '/media']);
     $this->configModel->process([]);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:9,代码来源:ConfigModelTest.php

示例11: testProcessWithException

 /**
  * @param array $structureElements
  *
  * @dataProvider processWithExceptionDataProvider
  * @expectedException \Magento\Framework\Exception\LocalizedException
  */
 public function testProcessWithException($structureElements)
 {
     $this->scheduledStructureMock->expects($this->once())->method('getElements')->willReturn($structureElements);
     $this->structureMock->expects($this->once())->method('setAttribute')->willReturnSelf();
     $this->container->process($this->readerContextMock, $this->generatorContextMock);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:ContainerTest.php

示例12: testProcess

 /**
  * @param FieldConfigModel $field
  * @param bool $isExist
  * @param FieldConfigModel|null $expected
  *
  * @dataProvider processProvider
  */
 public function testProcess($field, $isExist, $expected)
 {
     $this->databaseHelper->expects(static::any())->method('findOneBy')->willReturn($isExist ? $field : null);
     static::assertEquals($expected, $this->strategy->process($field));
 }
开发者ID:Maksold,项目名称:platform,代码行数:12,代码来源:EntityFieldImportStrategyTest.php

示例13: testProcessWithInvalidElementConfiguration

 /**
  * @covers ::process
  *
  * @expectedException \InvalidArgumentException
  *
  * @dataProvider providerTestProcess
  */
 public function testProcessWithInvalidElementConfiguration(array $element)
 {
     $form_state = $this->getMock(FormStateInterface::class);
     $form = [];
     $this->sut->process($element, $form_state, $form);
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:13,代码来源:PaymentReferenceBaseTest.php


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