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