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


PHP Mockery::resetContainer方法代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     \Mockery::resetContainer();
     $this->mockDatabase = \Mockery::mock("alias:" . Database::class);
     $this->mockDatabase->selectForUpdate = false;
     $this->mockDatabase->shouldReceive("getDefault")->andReturn($this->mockDatabase);
     $this->mockDatabase->shouldReceive("prepare")->with("SELECT * FROM `ModelStubATable` WHERE `id` = ? FOR UPDATE")->globally()->ordered();
     $this->mockDatabase->shouldReceive("prepare")->with("SELECT * FROM `ModelStubATable` WHERE `id` = ?")->globally()->ordered();
     $this->mockDatabase->shouldReceive("prepare")->with("SELECT * FROM `ModelStubBTable` WHERE `id` = ? FOR UPDATE")->globally()->ordered();
     $this->mockDatabase->shouldReceive("prepare")->with("SELECT * FROM `ModelStubBTable` WHERE `id` = ?")->globally()->ordered();
     ModelStubA::initialize();
     ModelStubB::initialize();
 }
开发者ID:pp3345,项目名称:ppframework,代码行数:13,代码来源:SelectTest.php

示例2: testInterfacesCanHaveAssertions

 public function testInterfacesCanHaveAssertions()
 {
     \Mockery::setContainer($this->container);
     $m = $this->container->mock('stdClass, ArrayAccess, Countable, Traversable');
     $m->shouldReceive('foo')->once();
     $m->foo();
     $this->container->mockery_verify();
     \Mockery::resetContainer();
 }
开发者ID:jyothid,项目名称:Xdocker,代码行数:9,代码来源:ContainerTest.php

示例3: testCallingSelfOnlyReturnsLastMockCreatedOrCurrentMockBeingProgrammedSinceTheyAreOneAndTheSame

 /**
  * @issue issue/35
  */
 public function testCallingSelfOnlyReturnsLastMockCreatedOrCurrentMockBeingProgrammedSinceTheyAreOneAndTheSame()
 {
     \Mockery::setContainer($this->container);
     $m = $this->container->mock('MockeryTestFoo');
     $this->assertFalse($this->container->self() instanceof MockeryTestFoo2);
     //$m = $this->container->mock('MockeryTestFoo2');
     //$this->assertTrue($this->container->self() instanceof MockeryTestFoo2);
     //$m = $this->container->mock('MockeryTestFoo');
     //$this->assertFalse(\Mockery::self() instanceof MockeryTestFoo2);
     //$this->assertTrue(\Mockery::self() instanceof MockeryTestFoo);
     \Mockery::resetContainer();
 }
开发者ID:deepakb,项目名称:test-driven-development-example,代码行数:15,代码来源:ContainerTest.php

示例4: sshConnectionShouldBeCloseWhenCommunicatorIsDestroy

 /**
  * @test
  */
 public function sshConnectionShouldBeCloseWhenCommunicatorIsDestroy()
 {
     m::resetContainer($this->ssh);
     $this->ssh->shouldReceive('disconnect')->once();
     $this->communicator->__destruct();
 }
开发者ID:sayiho,项目名称:Jumper,代码行数:9,代码来源:SshTest.php

示例5: testClassDeclaringUnsetDoesNotThrowException

 /**
  * @issue issue/21
  */
 public function testClassDeclaringUnsetDoesNotThrowException()
 {
     \Mockery::setContainer($this->container);
     $m = $this->container->mock('MockeryTest_UnsetMethod');
     $this->container->mockery_verify();
     \Mockery::resetContainer();
 }
开发者ID:cordoval,项目名称:mockery,代码行数:10,代码来源:ContainerTest.php


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