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