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


PHP App::clearResolvedInstances方法代码示例

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


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

示例1: it_should_bind_index

 /**
  * @test
  */
 public function it_should_bind_index()
 {
     /**
      * Set
      */
     App::clearResolvedInstances();
     App::shouldReceive('make')->with('menthol.flexible.index', m::any())->once()->andReturn('mock');
     App::shouldReceive('make')->with('Elasticsearch')->twice()->andReturn('mock');
     $config = m::mock('Menthol\\Flexible\\Config');
     App::shouldReceive('make')->with('Menthol\\Flexible\\Config')->once()->andReturn($config);
     $config->shouldReceive('get')->with('elasticsearch.index_prefix', '')->andReturn('');
     $model = m::mock('Illuminate\\Database\\Eloquent\\Model');
     $model->shouldReceive('getTable')->once()->andReturn('mockType');
     $app = m::mock('LaravelApp');
     $proxy = m::mock('Menthol\\Flexible\\Proxy', [$model]);
     $sp = m::mock('Menthol\\Flexible\\FlexibleServiceProvider[bindIndex]', [$app]);
     /**
      * Expectation
      */
     $app->shouldReceive('bind')->once()->andReturnUsing(function ($name, $closure) use($app, $proxy) {
         $this->assertEquals('menthol.flexible.index', $name);
         $this->assertInstanceOf('Menthol\\Flexible\\Index', $closure($app, ['proxy' => $proxy, 'name' => 'name']));
     });
     /**
      * Assertion
      */
     $sp->bindIndex();
 }
开发者ID:menthol,项目名称:Flexible,代码行数:31,代码来源:FlexibleServiceProviderTest.php

示例2: tearDown

 public function tearDown()
 {
     App::clearResolvedInstances();
     parent::tearDown();
 }
开发者ID:C4Tech,项目名称:laravel-ray-emitter,代码行数:5,代码来源:ServiceProviderTest.php

示例3: destroy

 /**
  * Force destroy the container
  *
  * WARNING: Avoid using this, unless you really need to
  * destroy the IoC!
  */
 public function destroy()
 {
     $this->container = null;
     App::clearResolvedInstances();
     App::setFacadeApplication(null);
     self::$instance = null;
 }
开发者ID:aedart,项目名称:scaffold,代码行数:13,代码来源:IoC.php

示例4: destroy

 /**
  * Destroy the Inversion of Control (IoC) Container
  */
 public static function destroy()
 {
     App::clearResolvedInstances();
     App::setFacadeApplication(null);
     self::setContainer(null);
 }
开发者ID:aedart,项目名称:data-transfer-object-dto,代码行数:9,代码来源:Bootstrap.php


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