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


PHP Log::shouldReceive方法代码示例

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


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

示例1: testListenToUploadModelClosure

 public function testListenToUploadModelClosure()
 {
     $model = Mockery::mock('UploadableModel');
     $repository = Mockery::mock('C4tech\\Upload\\Contracts\\UploadInterface');
     $repository->id = 16;
     $tags = ['tags'];
     $upload = Mockery::mock('UploadInstance');
     $uploadable = Mockery::mock('C4tech\\Upload\\Contracts\\UploadableModelInterface');
     $this->repo->shouldReceive('getModelClass')->withNoArgs()->once()->andReturn($model);
     Config::shouldReceive('get')->with('app.debug')->twice()->andReturn(true);
     Log::shouldReceive('debug')->with(Mockery::type('string'), Mockery::type('array'))->twice();
     $model->shouldReceive('updated');
     $model->shouldReceive('deleted');
     Upload::shouldReceive('getModelClass')->withNoArgs()->once()->andReturn($upload);
     $upload->shouldReceive('updated');
     $upload->shouldReceive('deleted')->with(Mockery::on(function ($closure) use($upload) {
         expect_not($closure($upload));
         return true;
     }));
     Upload::shouldReceive('make')->with($upload)->once()->andReturn($repository);
     $repository->shouldReceive('getTags')->with($model)->once()->andReturn($tags);
     Cache::shouldReceive('tags->flush')->with($tags)->withNoArgs()->once();
     $this->repo->shouldReceive('withUpload')->with($repository)->once()->andreturn([$uploadable]);
     $uploadable->shouldReceive('getModel->touch')->withNoArgs()->once();
     expect_not($this->repo->listenToUpload());
 }
开发者ID:C4Tech,项目名称:laravel-upload,代码行数:26,代码来源:RepositoryTraitTest.php

示例2: AujaConfigurator

 function __construct()
 {
     $this->application = m::mock('Illuminate\\Foundation\\Application');
     $this->databaseHelper = m::mock('Label305\\AujaLaravel\\Database\\DatabaseHelper');
     $this->aujaConfigurator = new AujaConfigurator($this->application, $this->databaseHelper);
     Log::shouldReceive('debug');
     Log::shouldReceive('info');
 }
开发者ID:hramose,项目名称:Auja-Laravel,代码行数:8,代码来源:AujaConfiguratorFeatureContext.php

示例3: testBootClosure

 public function testBootClosure()
 {
     $tag = ['test-123'];
     $node = Mockery::mock('C4tech\\Support\\Contracts\\ModelInterface');
     $node->parent = Mockery::mock('C4tech\\Support\\Contracts\\ModelInterface[touch]');
     $node->parent->shouldReceive('touch')->withNoArgs()->once();
     $model = Mockery::mock('stdClass');
     $model->shouldReceive('moved')->with(Mockery::on(function ($method) use($node) {
         expect_not($method($node));
         return true;
     }))->once();
     $model->shouldReceive('saved')->with(Mockery::on(function ($method) use($node) {
         expect_not($method($node));
         return true;
     }))->once();
     $model->shouldReceive('deleted')->once();
     Config::shouldReceive('get')->with(null, null)->twice()->andReturn($model, null);
     Config::shouldReceive('get')->with('app.debug')->times(3)->andReturn(true);
     Log::shouldReceive('info')->with(Mockery::type('string'), Mockery::type('array'))->once();
     Log::shouldReceive('debug')->with(Mockery::type('string'), Mockery::type('array'))->twice();
     Cache::shouldReceive('tags->flush')->with($tag)->withNoArgs()->once();
     $this->repo->shouldReceive('make->getParentTags')->with($node)->withNoArgs()->andReturn($tag);
     expect_not($this->repo->boot());
 }
开发者ID:C4Tech,项目名称:laravel-nested-sets,代码行数:24,代码来源:RepositoryTest.php

示例4: stubUpdate

 public function stubUpdate($data = null, $return = true)
 {
     Log::shouldReceive('debug')->with(Mockery::type('string'), Mockery::type('array'))->once();
     $this->repo->shouldReceive('getModelClass')->withNoArgs()->once()->andReturn('class');
     $this->mocked_model->shouldReceive('update')->with($data)->once()->andReturn($return);
 }
开发者ID:C4Tech,项目名称:laravel-support,代码行数:6,代码来源:Repository.php

示例5: testDelete

 public function testDelete()
 {
     $model = 'TestClass';
     $instances = ['tag' => 'A TestClass Instance'];
     $object = Mockery::mock('C4tech\\Support\\Model[delete]')->shouldReceive('delete')->once()->andReturn(true)->getMock();
     $object->id = 10;
     $this->repo->shouldReceive('getModelClass')->withNoArgs()->once()->andReturn($model);
     Log::shouldReceive('debug')->with(Mockery::type('string'), Mockery::type('array'))->once();
     $this->repo->shouldReceive('formatTag')->with($object->id)->once()->andReturn('tag');
     $reflection = new ReflectionClass($this->repo);
     $instance = $reflection->getProperty('object');
     $instance->setAccessible(true);
     $instance->setValue($this->repo, $object);
     $objects = $reflection->getProperty('instances');
     $objects->setAccessible(true);
     $objects->setValue($this->repo, $instances);
     expect($this->repo->delete())->true();
     expect($objects->getValue($this->repo))->hasntKey('tag');
 }
开发者ID:C4Tech,项目名称:laravel-support,代码行数:19,代码来源:RepositoryTest.php


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