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


PHP Facade::clearResolvedInstances方法代码示例

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


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

示例1: reboot

 /**
  * After each scenario, reboot the kernel.
  */
 public function reboot()
 {
     Facade::clearResolvedInstances();
     $lumen = new LumenBooter($this->app->basePath());
     $this->context->getSession('lumen')->getDriver()->reboot($this->app = $lumen->boot());
     $this->setAppOnContext();
 }
开发者ID:arisro,项目名称:behat-lumen-extension,代码行数:10,代码来源:ApplicationAwareInitializer.php

示例2: it_should_get_a_proxy

 /**
  * @test
  */
 public function it_should_get_a_proxy()
 {
     /**
      *
      * Set
      *
      */
     $proxy = m::mock('Iverberk\\Larasearch\\proxy');
     /**
      *
      * Expectation
      *
      */
     Facade::clearResolvedInstances();
     \Husband::clearProxy();
     App::shouldReceive('make')->with('iverberk.larasearch.proxy', m::type('Illuminate\\Database\\Eloquent\\Model'))->andReturn($proxy);
     /**
      *
      *
      * Assertion
      *
      */
     $proxy1 = \Husband::getProxy();
     $this->assertSame($proxy, $proxy1);
     $proxy2 = \Husband::getProxy();
     $this->assertSame($proxy, $proxy2);
 }
开发者ID:geekybeaver,项目名称:larasearch,代码行数:30,代码来源:SearchableTraitTest.php

示例3: bootstrap

 public function bootstrap(Application $app, $config)
 {
     \Illuminate\Support\Facades\Facade::clearResolvedInstances();
     \Illuminate\Support\Facades\Facade::setFacadeApplication($app);
     #注册别名并设置自动加载器
     \Illuminate\Foundation\AliasLoader::getInstance($config['app_aliases'])->register();
 }
开发者ID:jellycheng,项目名称:learnlaravel,代码行数:7,代码来源:demo.php

示例4: stopApplication

 /**
  * Stop the application
  *
  * @return void
  */
 public function stopApplication()
 {
     if ($this->hasApplicationBeenStarted()) {
         foreach ($this->beforeApplicationDestroyedCallbacks as $callback) {
             call_user_func($callback);
         }
         $this->app->flush();
         $this->app = null;
         Facade::clearResolvedInstances();
         Facade::setFacadeApplication(null);
     }
 }
开发者ID:aedart,项目名称:testing-laravel,代码行数:17,代码来源:ApplicationInitiatorTrait.php

示例5: setUp

 /**
  * Setup the test environment.
  *
  * @return void
  */
 protected function setUp()
 {
     if (!$this->app) {
         $this->refreshApplication();
     }
     $this->setUpTraits();
     foreach ($this->afterApplicationCreatedCallbacks as $callback) {
         call_user_func($callback);
     }
     Facade::clearResolvedInstances();
     Model::setEventDispatcher($this->app['events']);
     $this->setUpHasRun = true;
 }
开发者ID:notadd,项目名称:framework,代码行数:18,代码来源:TestCase.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     self::$functions = m::mock();
     $this->index = m::mock('Menthol\\Flexible\\Index');
     $this->model = m::mock('Husband')->makePartial();
     $this->client = m::mock('Elasticsearch\\Client');
     $this->model->shouldReceive('getTable')->once()->andReturn('Husbands');
     Facade::clearResolvedInstances();
     App::shouldReceive('make')->with('Elasticsearch')->once()->andReturn($this->client);
     App::shouldReceive('make')->with('menthol.flexible.index', m::type('array'))->once()->andReturn($this->index);
     $this->proxy = new Proxy($this->model);
     self::$functions->shouldReceive('date')->andReturn('9999');
 }
开发者ID:menthol,项目名称:Flexible,代码行数:14,代码来源:ProxyTest.php

示例7: createApplication

 /**
  * Creates the application.
  *
  * Needs to be implemented by subclasses.
  *
  * @return \Symfony\Component\HttpKernel\HttpKernelInterface
  */
 public function createApplication()
 {
     $app = new Application();
     $app->detectEnvironment(array('local' => array('your-machine-name')));
     $app->bindInstallPaths($this->getApplicationPaths());
     $app['env'] = 'testing';
     $app->instance('app', $app);
     Facade::clearResolvedInstances();
     Facade::setFacadeApplication($app);
     $app->registerCoreContainerAliases();
     with($envVariables = new EnvironmentVariables($app->getEnvironmentVariablesLoader()))->load($app['env']);
     $app->instance('config', $config = new Repository($app->getConfigLoader(), $app['env']));
     $app->startExceptionHandling();
     date_default_timezone_set($this->getApplicationTimezone());
     $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases());
     AliasLoader::getInstance($aliases)->register();
     Request::enableHttpMethodParameterOverride();
     $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders());
     $app->getProviderRepository()->load($app, $providers);
     $this->registerBootedCallback($app);
     return $app;
 }
开发者ID:arwinjp,项目名称:ODTS,代码行数:29,代码来源:TestCase.php

示例8: getMocks

 /**
  * Construct an Index mock
  *
  * @return array
  */
 private function getMocks($index_prefix = '')
 {
     /**
      *
      * Expectation
      *
      */
     Facade::clearResolvedInstances();
     $client = m::mock('Elasticsearch\\Client');
     $config = m::mock('Menthol\\Flexible\\Config');
     App::shouldReceive('make')->with('Elasticsearch')->andReturn($client);
     App::shouldReceive('make')->with('Menthol\\Flexible\\Config')->andReturn($config);
     $config->shouldReceive('get')->with('elasticsearch.index_prefix', '')->andReturn($index_prefix);
     $proxy = m::mock('Menthol\\Flexible\\Proxy');
     $proxy->shouldReceive('getModel->getTable')->andReturn('Husband');
     $index = m::mock('Menthol\\Flexible\\Index', [$proxy], [m::BLOCKS => ['setName', 'setProxy']])->makePartial();
     return [$index, $proxy, $client, $config];
 }
开发者ID:menthol,项目名称:Flexible,代码行数:23,代码来源:IndexTest.php

示例9: restoreAfterRequest

 public function restoreAfterRequest()
 {
     $this->make('config')->set($this->needBackupConfigs);
     // clear all, not just request
     Facade::clearResolvedInstances();
     foreach ($this->needBackUpAppAttributes as $attri) {
         //           echo "\n $attri\n";
         //if(is_array($this->$attri))
         //echo count($this->__oldValues[$attri]) - count($this->$attri);
         $this->{$attri} = $this->__oldValues[$attri];
     }
     foreach ($this->restoreTool as $tool) {
         $tool();
     }
     $this->bootedInRequest = false;
 }
开发者ID:kttis,项目名称:LaravelFly,代码行数:16,代码来源:Application.php

示例10: it_shoud_reindex_on_model_delete

 /**
  *
  */
 public function it_shoud_reindex_on_model_delete()
 {
     /**
      *
      * Expectation
      *
      */
     Facade::clearResolvedInstances();
     Queue::shouldReceive('push')->with('Iverberk\\Larasearch\\Jobs\\DeleteJob', ['Husband:2'])->once();
     Queue::shouldReceive('push')->with('Iverberk\\Larasearch\\Jobs\\ReindexJob', ['Wife:2', 'Child:2', 'Toy:2'])->once();
     Config::shouldReceive('get')->with('/^larasearch::reversedPaths\\..*$/', array())->once()->andReturn(['', 'wife', 'children', 'children.toys']);
     $husband = \Husband::find(2);
     with(new Observer())->deleted($husband);
 }
开发者ID:geekybeaver,项目名称:larasearch,代码行数:17,代码来源:ObserverTest.php

示例11: registerBaseFacades

 protected function registerBaseFacades()
 {
     Facade::clearResolvedInstances();
     Facade::setFacadeApplication($this);
     class_alias('Illuminate\\Support\\Facades\\App', 'App');
     class_alias('Illuminate\\Support\\Facades\\Schema', 'Schema');
     class_alias('Illuminate\\Support\\Facades\\Event', 'Event');
     class_alias('Illuminate\\Support\\Facades\\DB', 'DB');
     class_alias('Illuminate\\Database\\Eloquent\\Model', 'Eloquent');
     class_alias('Illuminate\\Support\\Facades\\File', 'File');
     class_alias('Illuminate\\Support\\Facades\\Config', 'Config');
     class_alias('Illuminate\\Support\\Facades\\Blade', 'Blade');
     class_alias('Illuminate\\Support\\Facades\\View', 'View');
 }
开发者ID:kohkimakimoto,项目名称:luster,代码行数:14,代码来源:Application.php

示例12: resolveApplicationCore

 /**
  * Resolve application core implementation.
  *
  * @param  \Illuminate\Foundation\Application  $app
  *
  * @return void
  */
 protected function resolveApplicationCore($app)
 {
     Facade::clearResolvedInstances();
     Facade::setFacadeApplication($app);
     $app->detectEnvironment(function () {
         return 'testing';
     });
 }
开发者ID:diegopan,项目名称:testbench,代码行数:15,代码来源:ApplicationTrait.php

示例13: _afterStep

 /**
  * After step hook.
  *
  * @param \Codeception\Step $step
  */
 public function _afterStep(\Codeception\Step $step)
 {
     \Illuminate\Support\Facades\Facade::clearResolvedInstances();
     parent::_afterStep($step);
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:10,代码来源:Laravel5.php

示例14: _afterStep

 /**
  * After step hook.
  *
  * @param \Codeception\Step $step
  */
 public function _afterStep(Step $step)
 {
     Facade::clearResolvedInstances();
 }
开发者ID:corcre,项目名称:elabftw,代码行数:9,代码来源:Lumen.php

示例15: boot

 /**
  * Boot Cubex, Setup Facades, & Service Providers
  */
 public function boot()
 {
     if ($this->_booted) {
         return null;
     }
     //Fix anything that hasnt been set by the projects bootstrap
     $this->prepareCubex();
     //Bind services
     $this->processConfiguration($this->getConfiguration());
     //Setup facades
     Facade::clearResolvedInstances();
     Facade::setFacadeApplication($this);
     FacadeLoader::register();
     //Setup Service Providers
     $serviceManager = new ServiceManager();
     $serviceManager->setCubex($this);
     $serviceManager->boot();
     $this->instance('service.manager', $serviceManager);
     $this->_booted = true;
 }
开发者ID:cubex,项目名称:framework,代码行数:23,代码来源:Cubex.php


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