|
@@ 42-51 (lines=10) @@
|
| 39 |
|
render_widget($widget); |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
public function test_controller_method_is_called_on_some_other_class() |
| 43 |
|
{ |
| 44 |
|
View::shouldReceive('exists')->once()->andReturn(true); |
| 45 |
|
View::shouldReceive('make')->once()->with('hello', ['data' => 'aaabbb'], [])->andReturn(app('view')); |
| 46 |
|
View::shouldReceive('render')->once()->andReturn('<br>'); |
| 47 |
|
|
| 48 |
|
//act |
| 49 |
|
$widget = new Widget4(); |
| 50 |
|
render_widget($widget, ['arg1' => 'aaa', 'arg2' => 'bbb']); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function test_data_is_passed_to_data_method_from_view() |
| 54 |
|
{ |
|
@@ 53-61 (lines=9) @@
|
| 50 |
|
render_widget($widget, ['arg1' => 'aaa', 'arg2' => 'bbb']); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function test_data_is_passed_to_data_method_from_view() |
| 54 |
|
{ |
| 55 |
|
View::shouldReceive('exists')->once()->andReturn(true); |
| 56 |
|
View::shouldReceive('make')->once()->with('hello', ['data' => '222111'], [])->andReturn(app('view')); |
| 57 |
|
View::shouldReceive('render')->once()->andReturn('<br>'); |
| 58 |
|
//act |
| 59 |
|
$widget = new Widget6(); |
| 60 |
|
render_widget($widget, ['foo' => '111', 'bar' => '222']); |
| 61 |
|
} |
| 62 |
|
} |
| 63 |
|
|