本文整理汇总了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());
}
示例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();
}
示例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());
}