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


PHP Mockery::close方法代码示例

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


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

示例1: tearDown

 /**
  * @inheritdoc
  */
 protected function tearDown()
 {
     $this->mockSocket = null;
     $this->mockFactory = null;
     m::close();
     parent::tearDown();
 }
开发者ID:hitmeister,项目名称:metrics,代码行数:10,代码来源:SocketHandlerTestCase.php

示例2: tearDown

 public function tearDown()
 {
     if ($this->db) {
         $this->db->drop();
     }
     m::close();
 }
开发者ID:shershams,项目名称:lmongo,代码行数:7,代码来源:LMongoQueryBuilderTest.php

示例3: tearDown

 public function tearDown()
 {
     unset($data);
     unset($model);
     Mockery::close();
     Artisan::call('migrate:rollback');
 }
开发者ID:mhosks,项目名称:libros,代码行数:7,代码来源:DataTest.php

示例4: tearDown

 /**
  * Remove all mock objects
  */
 public function tearDown()
 {
     unset($this->userManager);
     unset($this->authenticationManager);
     unset($this->commandTester);
     m::close();
 }
开发者ID:Okami-,项目名称:ilios,代码行数:10,代码来源:InvalidateUserTokenCommandTest.php

示例5: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->allowMockingNonExistentMethods(true);
     // Verify Mockery expectations.
     Mock::close();
 }
开发者ID:narrowspark,项目名称:testing-helper,代码行数:7,代码来源:MockeryTrait.php

示例6: tearDown

 /**
  * Tear down test env
  *
  * @return void
  * @author Dan Cox
  */
 public function tearDown()
 {
     m::close();
     if (!is_null($this->DI)) {
         $this->DI->clearMocks();
     }
 }
开发者ID:danzabar,项目名称:alice,代码行数:13,代码来源:TestCase.php

示例7: tearDown

 public function tearDown()
 {
     parent::tearDown();
     m::close();
     (new \UsersCreateTable())->down();
     Facades\Schema::drop('password_reminders');
 }
开发者ID:anlutro,项目名称:l4-core,代码行数:7,代码来源:PasswordResetTest.php

示例8: teardown

 public function teardown()
 {
     m::close();
     if ($this->useDatabase) {
         $this->teardownDb();
     }
 }
开发者ID:TheDigitalOrchard,项目名称:dbConfig,代码行数:7,代码来源:DbConfigTestCase.php

示例9: tearDown

 public function tearDown()
 {
     exec('rm -rf ' . __DIR__ . '/output');
     mkdir(__DIR__ . '/output');
     touch(__DIR__ . '/output/.gitkeep');
     Mockery::close();
 }
开发者ID:jmarcher,项目名称:valet-linux,代码行数:7,代码来源:DnsMasqTest.php

示例10: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Mockery::close();
     Test::clean();
     $this->dropDatabase();
 }
开发者ID:estebanmatias92,项目名称:pull-automatically-galleries,代码行数:7,代码来源:TestCase.php

示例11: tearDown

 public function tearDown()
 {
     unset($this->mockFileSystem);
     unset($this->iliosFileSystem);
     unset($this->fakeTestFileDir);
     m::close();
 }
开发者ID:stopfstedt,项目名称:ilios,代码行数:7,代码来源:IliosFileSystemTest.php

示例12: run

 /**
  * Runs the example
  * 
  * @param \PHPSpec\Runner\Reporter $reporter
  */
 public function run(Reporter $reporter)
 {
     try {
         $methodName = $this->_methodName;
         $startTime = microtime(true);
         call_user_func(array($this->_exampleGroup, 'before'));
         call_user_func(array($this->_exampleGroup, $methodName));
         call_user_func(array($this->_exampleGroup, 'after'));
         $endTime = microtime(true);
         $this->_executionTime = $endTime - $startTime;
         if (class_exists('Mockery')) {
             \Mockery::close();
         }
     } catch (Failure $failure) {
         $reporter->addFailure($this, $failure);
         return;
     } catch (Pending $pending) {
         $reporter->addPending($this, $pending);
         return;
     } catch (Error $error) {
         $reporter->addError($this, $error);
         return;
     } catch (\Exception $e) {
         $reporter->addException($this, new Exception($e));
         return;
     }
     $reporter->addPass($this);
 }
开发者ID:nrocy,项目名称:phpspec,代码行数:33,代码来源:Example.php

示例13: canApplyInflections

 /**
  * @test
  */
 public function canApplyInflections()
 {
     // Mocking argument resolver dependency.
     $resolver = Mockery::mock(ArgumentResolver::class);
     // Callback to be returned by ArgumentResolver::resolveArguments() method.
     // Expects $arguments array to contain 'value' key to merge.
     // Will return array of arguments for TestClass::setValue() method call.
     $callback = function (array $arguments) {
         return array_values(array_merge(['value' => 'to be replaced'], $arguments));
     };
     // Reflecting method to call on inflection.
     $reflection = new ReflectionMethod(TestClass::class, 'setValue');
     // Defining expectations.
     $resolver->shouldReceive('reflectCallable')->with([TestClass::class, 'setValue'])->andReturn($reflection)->once();
     $resolver->shouldReceive('resolveArguments')->with($reflection)->andReturn($callback)->once();
     // Creating inflector, setting resolver, adding inflection.
     $inflector = new ObjectInflector($resolver);
     $inflector->addInflection(TestClass::class, 'setValue', ['value' => 'value']);
     // Creating test object.
     $test = new TestClass(new stdClass());
     // At first value is empty.
     $this->assertNull($test->getValue());
     // Applying inflections.
     $inflector->applyInflections($test);
     // Now value was changed via TestClass::setValue() call.
     $this->assertSame('value', $test->getValue());
     // After first run inflection callable must be saved for better performance.
     $test2 = new TestClass(new stdClass());
     $inflector->applyInflections($test2);
     $this->assertSame($test->getValue(), $test2->getValue());
     // Inflection must be called only on TestClass instances.
     $inflector->applyInflections(Mockery::mock(stdClass::class)->shouldNotReceive('setValue')->getMock());
     Mockery::close();
 }
开发者ID:venta,项目名称:framework,代码行数:37,代码来源:ObjectInflectorTest.php

示例14: tearDown

 protected function tearDown()
 {
     \Mockery::close();
     $this->obj = null;
     $this->atts = null;
     $this->q = null;
 }
开发者ID:johnhenrymahr,项目名称:johnhenrymahr.com,代码行数:7,代码来源:TemplateTest.php

示例15: _after

 protected function _after()
 {
     m::close();
     if (isset($this->model)) {
         unset($this->model);
     }
 }
开发者ID:darkwebside,项目名称:Sprint,代码行数:7,代码来源:CIDbModelTest.php


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