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


PHP View::shouldReceive方法代码示例

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


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

示例1: testPjaxAndFullpageResponses

 public function testPjaxAndFullpageResponses()
 {
     $this->mockRequest->shouldReceive('wantsJson')->andReturn(false);
     View::shouldReceive('make')->with('view', [], [])->once()->andReturn('view');
     $this->respondable->respond('view');
     $this->assertEquals('whatever', $this->respondable->layout->main);
 }
开发者ID:kamaroly,项目名称:shift,代码行数:7,代码来源:RespondableTest.php

示例2: testIndex

 public function testIndex()
 {
     $this->markTestIncomplete('This test has not been implemented yet.');
     View::shouldReceive('make')->once()->with('cabinet::admin.index')->andReturn('admin index!');
     $response = $this->action('GET', self::$wardrobeControllers . 'AdminController@index');
     $this->assertSame('admin index!', $response->original);
 }
开发者ID:sekouzed,项目名称:cabinet,代码行数:7,代码来源:AdminControllerTest.php

示例3: testAssertViewIs

 public function testAssertViewIs()
 {
     View::shouldReceive('make')->once()->with('foo');
     $this->response->shouldReceive('getOriginalContent')->once()->andReturn(Mockery::mock(['getName' => 'foo']));
     $this->controller->show();
     $this->assertViewis('foo');
 }
开发者ID:Brother-Simon,项目名称:testing,代码行数:7,代码来源:ControllerHelpersTest.php

示例4: testGetViewReturnsDefaultViewWithNoView

 public function testGetViewReturnsDefaultViewWithNoView()
 {
     $template = new Template();
     View::shouldReceive('exists')->with(\Mockery::any())->andReturn(false);
     View::shouldReceive('make')->with('boomcms::templates.default');
     $template->getView();
 }
开发者ID:robbytaylor,项目名称:boom-core,代码行数:7,代码来源:TemplateTest.php

示例5: testPjaxRequest

 public function testPjaxRequest()
 {
     $this->mockRequest->shouldReceive('wantsJson')->andReturn(false);
     $this->mockRequest->shouldReceive('header')->with('X-PJAX')->twice()->andReturn('true');
     View::shouldReceive('make')->with('shift::layouts.pjax', [], [])->once();
     $this->controller->setup();
 }
开发者ID:kamaroly,项目名称:shift,代码行数:7,代码来源:ControllerTest.php

示例6: testRender

 public function testRender()
 {
     View::shouldReceive('make')->once()->with('datatable::template', \Mockery::any())->andReturn(true);
     $this->table->setUrl('fooBar');
     $table1 = $this->table->addColumn('foo')->render();
     $this->assertEquals(array('options' => '{ "sPaginationType":"full_numbers",' . PHP_EOL . '"bProcessing":false,' . PHP_EOL . '"sAjaxSource":"fooBar",' . PHP_EOL . '"bServerSide":true }', 'values' => array(), 'data' => array(), 'columns' => array(1 => 'foo'), 'noScript' => false, 'class' => $this->table->getClass(), 'id' => $this->table->getId()), $this->table->getViewParameters());
     $this->assertTrue($table1);
 }
开发者ID:MehmetNuri,项目名称:faveo-helpdesk,代码行数:8,代码来源:TableTest.php

示例7: testViewUsesNamespaceOfActivePageTemplate

 public function testViewUsesNamespaceOfActivePageTemplate()
 {
     $template = new Template(['theme' => 'test']);
     $page = $this->getMock(Page::class, ['getTemplate']);
     $page->expects($this->once())->method('getTemplate')->will($this->returnValue($template));
     Editor::shouldReceive('getActivePage')->andReturn($page);
     View::shouldReceive('make')->with('test::name', [])->andReturn('view');
     $this->assertEquals('view', Helpers::view('name'));
 }
开发者ID:robbytaylor,项目名称:boom-core,代码行数:9,代码来源:HelpersTest.php

示例8: testExecuteMethod

 /**
  * Specs for RouteGenerator::execute()
  */
 public function testExecuteMethod()
 {
     $class = $this->prepareSpecify();
     $this->specify('renders if one class name is passed.', function () use($class) {
         View::shouldReceive('make->render')->once()->andReturn('test output');
         $params = ['element' => 'test'];
         expect($class->execute($params))->equals('test output');
     });
 }
开发者ID:impleri,项目名称:laravel-resource,代码行数:12,代码来源:RouteGeneratorTest.php

示例9: testSendSMSNotification

 public function testSendSMSNotification()
 {
     $twilioClient = new stdClass();
     $twilioClient->account = new stdClass();
     $messageService = Mockery::mock('stdClass');
     $twilioClient->account->sms_messages = $messageService;
     $messageService->shouldReceive('create')->once()->with('1234', 'fooUser', 'renderedContent');
     $viewContent = Mockery::mock('stdClass');
     $viewContent->shouldReceive('render')->once()->andReturn('renderedContent');
     $sms = new \Skovachev\Notifier\Notifiers\SMSNotifier($twilioClient);
     Config::shouldReceive('get')->once()->with('notifier::sms.enabled')->andReturn(true);
     Config::shouldReceive('get')->once()->with('notifier::sms.getter_phone')->andReturn(function ($user) {
         return $user;
     });
     Config::shouldReceive('get')->once()->with('notifier::sms.twilio.phone_number')->andReturn('1234');
     Config::shouldReceive('get')->once()->with('notifier::views_folder')->andReturn('foobar');
     View::shouldReceive('make')->once()->with('foobar.sms.fooView', array('foo' => 'bar', 'user' => 'fooUser'))->andReturn($viewContent);
     $sms->notify('fooUser', 'fooView', array('foo' => 'bar'));
 }
开发者ID:skovachev,项目名称:notifier,代码行数:19,代码来源:SMSNotifierTest.php

示例10: testExecuteMethod

 /**
  * Specs for Generator::execute()
  */
 public function testExecuteMethod()
 {
     $class = $this->prepareSpecify();
     $this->specify('renders if one class name is passed.', function () use($class) {
         View::shouldReceive('make->render')->once()->andReturn('test output');
         File::shouldReceive('exists')->twice()->with('/\\.php$/')->andReturn(false);
         File::shouldReceive('put')->once()->with('/\\.php$/', 'test output')->andReturn(true);
         $params = ['classes' => ['test' => []]];
         expect($class->execute($params))->greaterThan(0);
     });
     $this->specify('does not count failed views.', function () use($class) {
         View::shouldReceive('make->render')->once()->andReturn('test output');
         File::shouldReceive('exists')->twice()->with('/\\.php$/')->andReturn(false);
         File::shouldReceive('put')->once()->with('/\\.php$/', 'test output')->andReturn(false);
         $params = ['classes' => ['test' => []]];
         expect($class->execute($params))->equals(0);
     });
     $this->specify('keeps overridden view.', function () use($class) {
         View::shouldReceive('make')->once()->with('test::view', Mockery::type('array'));
         View::shouldReceive('make->render')->once()->andReturn('test output');
         File::shouldReceive('exists')->twice()->with('/\\.php$/')->andReturn(false);
         File::shouldReceive('put')->once()->with('/\\.php$/', 'test output')->andReturn(true);
         $params = ['classes' => ['test' => []]];
         expect($class->execute($params))->greaterThan(0);
     });
 }
开发者ID:impleri,项目名称:laravel-resource,代码行数:29,代码来源:GeneratorTest.php

示例11: testRemindForm

 public function testRemindForm()
 {
     View::shouldReceive('make')->once()->with('cabinet::admin.auth.forgot')->andReturn('forgot my password');
     $response = $this->action('GET', self::$wardrobeControllers . 'LoginController@remindForm');
     $this->assertSame('forgot my password', $response->original);
 }
开发者ID:sekouzed,项目名称:cabinet,代码行数:6,代码来源:LoginControllerTest.php

示例12: testLinkWithPermissionsAllowed

 public function testLinkWithPermissionsAllowed()
 {
     $this->mockPermissonsService->shouldReceive('permits')->once()->with(['User' => 'write'])->andReturn(true);
     View::shouldReceive('make')->with('shift::html.buttons.link', ['title' => 'Edit user', 'url' => 'users/edit/1', 'icon' => '', 'iconClass' => '', 'size' => 'big', 'type' => ''])->once()->andReturn('permitted button');
     $this->assertEquals('permitted button', $this->buttonBuilder->link('users/edit/1', 'Edit user', ['permissions' => ['User' => 'write']]));
 }
开发者ID:kamaroly,项目名称:shift,代码行数:6,代码来源:ButtonBuilderTest.php


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