當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。