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


PHP Facade::setFacadeApplication方法代码示例

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


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

示例1: setUp

 /**
  * Bootstrap the test environemnt:
  * - Create an application instance and register it within itself.
  * - Register the package service provider with the app.
  * - Set the APP facade.
  *
  * @return void
  */
 public function setUp()
 {
     $app = new Application();
     $app->instance('app', $app);
     $app->register('Ideil\\LaravelFileOre\\LaravelFileOreServiceProvider');
     Facade::setFacadeApplication($app);
 }
开发者ID:ideil,项目名称:laravel-fileore,代码行数:15,代码来源:TestCase.php

示例2: 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

示例3: __construct

 public function __construct($values = array())
 {
     parent::__construct();
     static::$app = $this;
     foreach ($values as $key => $value) {
         $this[$key] = $value;
     }
     Facade::setFacadeApplication($this);
     // register the configserviceprovider so we can access the config
     $this->register(new ConfigServiceProvider());
     // grab the providers from the config and load them
     $providers = $this['config']->get('app/providers');
     foreach ($providers as $provider) {
         $this->register(new $provider());
     }
     // set the locale (https://github.com/silexphp/Silex/issues/983)
     $locale = $values['locale'];
     if ($this['translator']) {
         $this['translator']->setlocale($locale);
     }
     // register fieldtypes from config
     $fieldTypesConfig = $this['config']->get('fieldtypes');
     if ($fieldTypesConfig) {
         $this['fieldtypes'] = $this['fieldtypes.factory']->fromConfig($fieldTypesConfig);
     }
     // register contenttypes from config
     $contentTypeConfig = $this['config']->get('contenttypes');
     if ($contentTypeConfig) {
         $this['contenttypes'] = $this['contenttypes.factory']->fromConfig($contentTypeConfig);
     }
 }
开发者ID:vespakoen,项目名称:bolt-core,代码行数:31,代码来源:App.php

示例4: register

 public function register()
 {
     $this->app->container->singleton('ioc', function () {
         return new Container();
     });
     Facade::setFacadeApplication($this->app->ioc);
 }
开发者ID:krisanalfa,项目名称:worx,代码行数:7,代码来源:Ioc.php

示例5: create

 public static function create()
 {
     $instance = new self();
     // Swap the Facade app with our container (to use these mocks)
     Facade::setFacadeApplication($instance->app);
     return $instance->app;
 }
开发者ID:nstapelbroek,项目名称:culpa-laravel-5,代码行数:7,代码来源:AppFactory.php

示例6: createApplication

 /**
  * Creates the application.
  *
  * @return \Symfony\Component\HttpKernel\HttpKernelInterface
  */
 public function createApplication()
 {
     Facade::setFacadeApplication($app = new Application());
     $app['env'] = 'testing';
     $app['path'] = 'app_path';
     $app['path.config'] = 'config_path';
     return $app;
 }
开发者ID:pressor,项目名称:framework,代码行数:13,代码来源:TestCase.php

示例7: it_returns_the_schema_builder

 /** @test */
 public function it_returns_the_schema_builder()
 {
     $migration = new MigrationStub();
     $mock = Mockery::mock('Illuminate\\Database\\Connection');
     Facade::setFacadeApplication(['db' => $mock]);
     $mock->shouldReceive('getSchemaBuilder')->once()->andReturn('foo');
     $this->assertEquals('foo', $migration->getSchemaBuilder());
 }
开发者ID:ymnl007,项目名称:laravel-fk-migration,代码行数:9,代码来源:MigrationTest.php

示例8: setUp

 public function setUp()
 {
     $app = M::mock('Application');
     $app = $app->shouldReceive('make')->with('path.public')->andReturn('tmp');
     $app = $app->shouldReceive('make')->with('path')->andReturn('tests');
     $app = $app->mock();
     Facade::setFacadeApplication($app);
 }
开发者ID:RHoKAustralia,项目名称:onaroll21_backend,代码行数:8,代码来源:LangJsCommandTest.php

示例9: setUp

 /**
  * setUp method.
  */
 public function setUp()
 {
     // Bootstrap the application container
     $app = new Application();
     $app->instance('app', $app);
     $app->register('Codesleeve\\FixtureL4\\FixtureL4ServiceProvider');
     Facade::setFacadeApplication($app);
 }
开发者ID:saga64,项目名称:fixture-l4,代码行数:11,代码来源:FixtureL4ServiceProvider.php

示例10: testMapping

 public function testMapping()
 {
     Facade::setFacadeApplication(new ApplicationStub());
     $configuration = ['driver' => 'sqlite', 'database' => 'db', 'username' => 'somedude', 'prefix' => 'mitch_', 'charset' => 'whatevs'];
     $expected = ['driver' => 'pdo_sqlite', 'path' => 'path/database/db.sqlite', 'user' => $configuration['username']];
     $actual = $this->sqlMapper->map($configuration);
     $this->assertEquals($expected, $actual);
 }
开发者ID:jorrit77,项目名称:laravel-doctrine,代码行数:8,代码来源:SqliteMapperTest.php

示例11: setUp

 protected function setUp()
 {
     $this->controller = new CommodeControllerTestSubject();
     $this->applicationMock = $this->getMock('Illuminate\\Foundation\\Application', ['make']);
     $this->requestMock = $this->getMock('Illuminate\\Http\\Request', ['ajax']);
     $this->resolver = new Resolver($this->applicationMock);
     Facade::setFacadeApplication($this->applicationMock);
     parent::setUp();
 }
开发者ID:laravel-commode,项目名称:common,代码行数:9,代码来源:CommodeControllerTest.php

示例12: __construct

 public function __construct(array $attributes)
 {
     $this->encrypter = new Encrypter('088409730f085dd15e8e3a7d429dd185', 'AES-256-CBC');
     $app = new Container();
     $app->singleton('app', 'Illuminate\\Container\\Container');
     $app->singleton('config', 'Illuminate\\Config\\Repository');
     $app['config']->set('elocrypt.prefix', '__ELOCRYPT__:');
     Facade::setFacadeApplication($app);
     parent::__construct($attributes);
 }
开发者ID:delatbabel,项目名称:elocryptfive,代码行数:10,代码来源:DummyModel.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     /** @var \Illuminate\Foundation\Application|\PHPUnit_Framework_MockObject_Builder_InvocationMocker $app */
     $app = $this->getMockBuilder('\\Illuminate\\Foundation\\Application')->disableOriginalConstructor()->getMock();
     $app->method('make')->willReturn('\\GionniValeriana\\laravelAdminlte\\Adminlte');
     Illuminate\Container\Container::setInstance(new Container());
     Facade::setFacadeApplication($app);
     $this->MockedBaseMenuItem = $this->getMockBuilder('\\SleepingOwl\\Admin\\Menu\\MenuItem')->disableOriginalConstructor()->getMock();
     $this->MockedMenuItem = $this->getMockBuilder('\\GionniValeriana\\laravelAdminlte\\MenuItem')->disableOriginalConstructor()->getMock();
 }
开发者ID:marwein,项目名称:laravel-adminlte,代码行数:11,代码来源:AdminTest.php

示例14: testAllWorks

 public function testAllWorks()
 {
     $this->prepareFakeData();
     $app = m::mock('AppMock');
     $app->shouldReceive('instance')->once()->andReturn($app);
     \Illuminate\Support\Facades\Facade::setFacadeApplication($app);
     \Illuminate\Support\Facades\Config::swap($config = m::mock('ConfigMock'));
     $config->shouldReceive('get')->once()->andReturn(5);
     $objs = $this->r->all();
     $this->assertEquals(5, count($objs));
 }
开发者ID:palmabit,项目名称:catalog,代码行数:11,代码来源:EloquentProductsRepositoryTest.php

示例15: 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


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