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


PHP Request::shouldReceive方法代码示例

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


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

示例1: testNormalResponseIsReturnedIfMethodIsMissing

 public function testNormalResponseIsReturnedIfMethodIsMissing()
 {
     Request::shouldReceive('getContent')->andReturn(json_encode(['type' => 'foo.bar', 'id' => 'event-id']));
     $controller = new WebhookControllerTestStub();
     $response = $controller->handleWebhook();
     $this->assertEquals(200, $response->getStatusCode());
 }
开发者ID:syntropysoftware,项目名称:cryptoffice-frontend,代码行数:7,代码来源:WebhookControllerTest.php

示例2: testRender

 public function testRender()
 {
     Request::shouldReceive('url')->once()->andReturn('fooBar');
     View::shouldReceive('make')->once()->with('datatable::template', array('options' => array('sAjaxSource' => 'fooBar', 'bServerSide' => true, 'sPaginationType' => 'full_numbers', 'bProcessing' => false), 'callbacks' => array(), 'values' => array(), 'data' => array(), 'columns' => array(1 => 'foo'), 'noScript' => false, 'class' => $this->table->getClass(), 'id' => $this->table->getId()))->andReturn(true);
     $table1 = $this->table->addColumn('foo')->render();
     $this->assertTrue($table1);
 }
开发者ID:Cyber-Duck,项目名称:Datatable,代码行数:7,代码来源:TableTest.php

示例3: testGetApiPrefix

 public function testGetApiPrefix()
 {
     Config::shouldReceive('get')->with('andizzle/rest-framework::deprecated')->andReturn(array());
     Config::shouldReceive('get')->with('andizzle/rest-framework::version')->andReturn('v1');
     Request::shouldReceive('segments')->once()->andReturn(array('api', 'v1', 'test'));
     $server = new RestServer();
     $this->assertEquals($server->getApiPrefix(), '/api/v1');
 }
开发者ID:andizzle,项目名称:rest-framework,代码行数:8,代码来源:RestServerTest.php

示例4: canObtainCookieValue

 /**
  * NOTE: test is perform outside Laravel
  *
  * @test
  * @covers ::getCookieValue
  */
 public function canObtainCookieValue()
 {
     $this->stopLaravel();
     $key = $this->faker->word;
     $value = $this->faker->sentence;
     RequestFacade::shouldReceive('cookie')->with($key, null)->andReturn($value);
     $mock = $this->getTraitMock();
     $this->assertSame($value, $mock->getCookieValue($key), 'Incorrect value returned');
 }
开发者ID:aedart,项目名称:laravel-helpers,代码行数:15,代码来源:CookieTraitTest.php

示例5: it_should_return_a_list_of_input_and_meta_attributes

 /**
  * It should return a list of input and meta attributes
  *
  * @return void
  * @test
  */
 public function it_should_return_a_list_of_input_and_meta_attributes()
 {
     $ip = '192.168.1.1';
     $input = ['foo' => 'foo', 'bar' => 'bar'];
     Request::shouldReceive('ip')->withNoArgs()->once()->andReturn($ip);
     Request::shouldReceive('all')->withNoArgs()->once()->andReturn($input);
     $inputAndMetaAttributes = $this->requestMetaAttributes->getInputAndMetaAttributes();
     $expected = ['meta_ip_address' => $ip, 'foo' => 'foo', 'bar' => 'bar'];
     $this->assertEquals($expected, $inputAndMetaAttributes);
 }
开发者ID:emmanuellozoya,项目名称:laravel-common,代码行数:16,代码来源:RequestMetaAttributesTest.php


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