本文整理汇总了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());
}
示例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');
}
示例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());
}
示例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);
}
示例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');
}