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


PHP Mockery::not方法代码示例

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


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

示例1: testUnsettingChildrenRestoresContentType

 public function testUnsettingChildrenRestoresContentType()
 {
     $cType = $this->_createHeader('Content-Type', 'text/plain', array(), false);
     $child = $this->_createChild(Swift_Mime_MimeEntity::LEVEL_ALTERNATIVE);
     $cType->shouldReceive('setFieldBodyModel')->twice()->with('image/jpeg');
     $cType->shouldReceive('setFieldBodyModel')->once()->with('multipart/alternative');
     $cType->shouldReceive('setFieldBodyModel')->zeroOrMoreTimes()->with(\Mockery::not('multipart/alternative', 'image/jpeg'));
     $entity = $this->_createEntity($this->_createHeaderSet(array('Content-Type' => $cType)), $this->_createEncoder(), $this->_createCache());
     $entity->setContentType('image/jpeg');
     $entity->setChildren(array($child));
     $entity->setChildren(array());
 }
开发者ID:saj696,项目名称:pipe,代码行数:12,代码来源:AbstractMimeEntityTest.php

示例2: testNotConstraintThrowsExceptionWhenConstraintUnmatched

 /**
  * @expectedException \Mockery\Exception
  */
 public function testNotConstraintThrowsExceptionWhenConstraintUnmatched()
 {
     $this->mock->shouldReceive('foo')->with(Mockery::not(2))->once();
     $this->mock->foo(2);
     $this->container->mockery_verify();
 }
开发者ID:carriercomm,项目名称:CraigslistX,代码行数:9,代码来源:ExpectationTest.php

示例3: testRunWithCoverage

 /**
  * Test description.
  *
  * @return void
  */
 public function testRunWithCoverage()
 {
     $expected_coverage = array('test1' => 'test2');
     $remote_coverage_helper = m::mock('aik099\\PHPUnit\\RemoteCoverage\\RemoteCoverageHelper');
     $remote_coverage_helper->shouldReceive('get')->with('some-url', 'tests\\aik099\\PHPUnit\\Fixture\\WithoutBrowserConfig__getTestId')->andReturn($expected_coverage);
     /* @var $test_case BrowserTestCase */
     /* @var $session_strategy ISessionStrategy */
     list($test_case, $session_strategy) = $this->prepareForRun();
     $test_case->setName('getTestId');
     $test_case->setRemoteCoverageHelper($remote_coverage_helper);
     $test_case->setRemoteCoverageScriptUrl('some-url');
     $code_coverage = m::mock('\\PHP_CodeCoverage');
     $code_coverage->shouldReceive('append')->with($expected_coverage, $test_case)->once();
     $result = $this->getTestResult($test_case, 1, true);
     $result->shouldReceive('getCodeCoverage')->once()->andReturn($code_coverage);
     $test_id = $test_case->getTestId();
     $this->assertEmpty($test_id);
     $browser = $test_case->getBrowser();
     $browser->shouldReceive('getBaseUrl')->once()->andReturn('A');
     $session = m::mock('\\Behat\\Mink\\Session');
     $session->shouldReceive('visit')->with('A')->once();
     $session->shouldReceive('setCookie')->with(RemoteCoverageTool::TEST_ID_VARIABLE, null)->once();
     $session->shouldReceive('setCookie')->with(RemoteCoverageTool::TEST_ID_VARIABLE, m::not(''))->once();
     $session_strategy->shouldReceive('session')->once()->andReturn($session);
     $test_case->run($result);
     $this->assertNotEmpty($test_case->getTestId());
 }
开发者ID:aik099,项目名称:phpunit-mink,代码行数:32,代码来源:BrowserTestCaseTest.php


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