當前位置: 首頁>>代碼示例>>PHP>>正文


PHP URL::shouldReceive方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\URL::shouldReceive方法的典型用法代碼示例。如果您正苦於以下問題:PHP URL::shouldReceive方法的具體用法?PHP URL::shouldReceive怎麽用?PHP URL::shouldReceive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\URL的用法示例。


在下文中一共展示了URL::shouldReceive方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_image_thumb_url

 public function test_image_thumb_url()
 {
     Filesystem::shouldReceive('extractName')->once()->with('foo/bar.jpg')->andReturn('bar.jpg');
     Filesystem::shouldReceive('extension')->once()->with('foo/bar.jpg')->andReturn('jpg');
     URL::shouldReceive('asset')->once()->with('foo/bar.jpg')->andReturn('http://www.example.com/foo/bar.jpg');
     $item = new Item('foo/bar.jpg');
     $this->assertEquals('http://www.example.com/foo/bar.jpg', $item->thumb);
 }
開發者ID:spescina,項目名稱:mediabrowser,代碼行數:8,代碼來源:ItemTest.php

示例2: it_generates_not_rewrite_url_if_config_value_is_false

 /** @test */
 public function it_generates_not_rewrite_url_if_config_value_is_false()
 {
     Config::shouldReceive('get')->once()->with("imgproxy::rewrite")->andReturn(false);
     URL::shouldReceive('to')->once()->with("packages/spescina/imgproxy/timthumb.php?w=100&h=70&zc=1&q=90&src=image/path/url.jpg")->andReturn("http://www.example.com/packages/spescina/imgproxy/timthumb.php?w=100&h=70&zc=1&q=90&src=image/path/url.jpg");
     $imgProxy = new Imgproxy();
     $url = $imgProxy->link("image/path/url.jpg", 100, 70);
     $this->assertEquals("http://www.example.com/packages/spescina/imgproxy/timthumb.php?w=100&h=70&zc=1&q=90&src=image/path/url.jpg", $url);
 }
開發者ID:spescina,項目名稱:imgproxy,代碼行數:9,代碼來源:ImgproxyTest.php

示例3: let

 function let(AujaConfigurator $aujaConfigurator, AujaRouter $aujaRouter, Model $model)
 {
     $this->beConstructedWith($aujaConfigurator, $aujaRouter);
     URL::shouldReceive('route');
     Lang::shouldReceive('trans')->with('Add')->andReturn('Add');
     Lang::shouldReceive('trans')->with('Model')->andReturn('Model');
     $aujaConfigurator->getModel('Model')->willReturn($model);
     $aujaConfigurator->isSearchable($model, null)->willReturn(false);
 }
開發者ID:hramose,項目名稱:Auja-Laravel,代碼行數:9,代碼來源:NoAssociationsIndexMenuFactorySpec.php

示例4: test_is_active

 public function test_is_active()
 {
     Route::shouldReceive('currentRouteName')->once()->andReturn('about');
     $this->assertEquals('active', isActive(['faq', 'about']));
     Route::shouldReceive('currentRouteName')->once()->andReturn('home');
     $this->assertEquals('active', isActive('home'));
     URL::shouldReceive('current')->once()->andReturn('http://localhost:8000/about');
     $this->assertEquals('custom-clas-name', isActive('about', 'custom-clas-name'));
     Route::shouldReceive('currentRouteName')->once()->andReturn('news');
     $this->assertEquals('', isActive('home'));
 }
開發者ID:shammadahmed,項目名稱:LaravelHelpers,代碼行數:11,代碼來源:HelpersTest.php

示例5: let

 function let(AujaRouter $aujaRouter, Relation $relation, Model $left, Model $right)
 {
     $this->beConstructedWith($aujaRouter);
     $this->relation = $relation;
     $relation->getLeft()->willReturn($left);
     $relation->getRight()->willReturn($right);
     $relation->getType()->willReturn('hasMany');
     $left->getName()->willReturn('Model');
     $right->getName()->willReturn('OtherModel');
     URL::shouldReceive('route');
     Lang::shouldReceive('trans')->with('Edit')->andReturn('Edit');
     Lang::shouldReceive('trans')->with('Properties')->andReturn('Properties');
     Lang::shouldReceive('trans')->with('OtherModel')->andReturn('OtherModel');
 }
開發者ID:hramose,項目名稱:Auja-Laravel,代碼行數:14,代碼來源:SingleAssociationIndexMenuFactorySpec.php

示例6: let

 function let(AujaConfigurator $aujaConfigurator, AujaRouter $aujaRouter, Relation $relation, Model $left, Model $right)
 {
     $this->beConstructedWith($aujaConfigurator, $aujaRouter);
     $this->relations = [$relation];
     $relation->getLeft()->willReturn($left);
     $relation->getRight()->willReturn($right);
     $relation->getType()->willReturn('hasMany');
     $left->getName()->willReturn('Model');
     $right->getName()->willReturn('OtherModel');
     $aujaConfigurator->getModel('Model')->willReturn($left);
     $aujaConfigurator->getRelationsForModel($left)->willReturn([$relation]);
     $aujaConfigurator->getDisplayField($left)->willReturn('name');
     $aujaConfigurator->getIcon($left)->willReturn(null);
     URL::shouldReceive('route');
     Lang::shouldReceive('trans')->with('Add')->andReturn('Add');
     Lang::shouldReceive('trans')->with('Model')->andReturn('Model');
 }
開發者ID:hramose,項目名稱:Auja-Laravel,代碼行數:17,代碼來源:ResourceItemsFactorySpec.php

示例7: let

 function let(AujaConfigurator $aujaConfigurator, AujaRouter $aujaRouter, FormItemFactory $formItemFactory, TextFormItem $formItem, Model $model, Column $column1, Column $column2)
 {
     $this->beConstructedWith($aujaConfigurator, $aujaRouter, $formItemFactory);
     $aujaConfigurator->getModel('MyModel')->willReturn($model);
     $aujaConfigurator->getVisibleFields($model, null)->willReturn($this->visibleFields);
     $formItemFactory->getFormItem($model, $column1, null)->willReturn($formItem);
     $formItemFactory->getFormItem($model, $column2, null)->willReturn($formItem);
     $model->getColumn('field1')->willReturn($column1);
     $column1->getName()->willReturn('field1');
     $column1->getType()->willReturn(Type::STRING);
     $model->getColumn('field2')->willReturn($column2);
     $column2->getName()->willReturn('field2');
     $column2->getType()->willReturn(Type::STRING);
     Lang::shouldReceive('trans')->with('field1')->andReturn('field1');
     Lang::shouldReceive('trans')->with('field2')->andReturn('field2');
     Lang::shouldReceive('trans')->with('Submit')->andReturn('Submit');
     Lang::shouldReceive('trans')->with('Delete')->andReturn('Delete');
     Lang::shouldReceive('trans')->with('Are you sure?')->andReturn('Are you sure?');
     URL::shouldReceive('route');
 }
開發者ID:hramose,項目名稱:Auja-Laravel,代碼行數:20,代碼來源:PageFactorySpec.php

示例8: Form

 function its_created_main_has_a_proper_authentication_form()
 {
     URL::shouldReceive('route');
     $form = new Form();
     $main = $this->create('Title', true, 'Username', 'target', $form)->getWrappedObject();
     /* @var $main Main */
     if ($main->getAuthenticationForm() != $form) {
         throw new \Exception('Created Main has wrong authentication form');
     }
 }
開發者ID:hramose,項目名稱:Auja-Laravel,代碼行數:10,代碼來源:MainFactorySpec.php


注:本文中的Illuminate\Support\Facades\URL::shouldReceive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。