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


PHP Container::shouldReceive方法代码示例

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


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

示例1: test_cant_extend_with_an_invalid_class

 public function test_cant_extend_with_an_invalid_class()
 {
     $this->registry->shouldReceive('getManager')->once()->with('default')->andReturn($this->em);
     $this->container->shouldReceive('make')->once()->with(InvalidDoctrineExtender::class)->andReturn(new InvalidDoctrineExtender());
     $this->setExpectedException(InvalidArgumentException::class);
     $this->manager->extend('default', InvalidDoctrineExtender::class);
 }
开发者ID:spohess,项目名称:orm,代码行数:7,代码来源:DoctrineManagerTest.php

示例2: test_can_set_route

 public function test_can_set_route()
 {
     $urlMock = m::mock('Illuminate\\Contracts\\Routing\\UrlGenerator');
     $urlMock->shouldReceive('route')->andReturn('url');
     $this->container->shouldReceive('make')->andReturn($urlMock);
     $this->routeable->route('route');
     $this->assertEquals('url', $this->routeable->getUrl());
 }
开发者ID:fordongu,项目名称:maigc-menubar,代码行数:8,代码来源:RouteableTraitTest.php

示例3: mockContainerMake

 protected function mockContainerMake($name = null, $weight = null)
 {
     $mock = m::mock('Maatwebsite\\Sidebar\\Item');
     $mock->shouldReceive('name');
     $mock->shouldReceive('getName')->andReturn($name);
     $mock->shouldReceive('getWeight')->andReturn($weight);
     $this->container->shouldReceive('make')->with('Maatwebsite\\Sidebar\\Item')->andReturn($mock);
     return $mock;
 }
开发者ID:fordongu,项目名称:maigc-menubar,代码行数:9,代码来源:ItemableTraitTest.php

示例4: test_driver_can_return_a_given_driver

 public function test_driver_can_return_a_given_driver()
 {
     $this->app->shouldReceive('resolve')->andReturn(new Yaml($this->cache));
     $this->assertInstanceOf(Yaml::class, $this->manager->driver('yaml'));
 }
开发者ID:ryan-senn,项目名称:orm,代码行数:5,代码来源:MetaDataManagerTest.php

示例5: test_driver_can_return_a_given_driver

 public function test_driver_can_return_a_given_driver()
 {
     $config = m::mock(Repository::class);
     $this->app->shouldReceive('resolve')->andReturn(new FileCacheProvider($config));
     $this->assertInstanceOf(FileCacheProvider::class, $this->manager->driver());
 }
开发者ID:Devitek,项目名称:orm,代码行数:6,代码来源:CacheManagerTest.php

示例6: enableLaravelNamingStrategy

 protected function enableLaravelNamingStrategy()
 {
     $strategy = m::mock(LaravelNamingStrategy::class);
     $this->container->shouldReceive('make')->with(LaravelNamingStrategy::class)->once()->andReturn($strategy);
     $this->configuration->shouldReceive('setNamingStrategy')->once()->with($strategy);
 }
开发者ID:Devitek,项目名称:orm,代码行数:6,代码来源:EntityManagerFactoryTest.php

示例7: test_driver_can_return_a_given_driver

 public function test_driver_can_return_a_given_driver()
 {
     $this->app->shouldReceive('resolve')->andReturn((new SqliteConnection($this->config))->resolve());
     $this->assertTrue(is_array($this->manager->driver('sqlite')));
     $this->assertContains('pdo_sqlite', $this->manager->driver());
 }
开发者ID:Devitek,项目名称:orm,代码行数:6,代码来源:ConnectionManagerTest.php


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