public function it_can_run_nested_async_widget_with_dot_notation(LaravelApplicationWrapper $wrapper) { $config = ['count' => 5]; $params = [$config]; $wrapper->csrf_token()->willReturn('token_stub'); $this->run('profile.testNamespace.testFeed', $config)->shouldReturn('<div id="brainkit-widget-container-1" style="display:inline" class="brainkit-widget-container">' . "<script type=\"text/javascript\">\$('#brainkit-widget-container-1').load('/brainkit/load-widget', " . $this->mockProduceJavascriptData('Profile\\testNamespace\\testFeed', $params) . ')</script>' . '</div>'); }
public function it_can_run_widget_with_custom_container(LaravelApplicationWrapper $wrapper) { $config = []; $params = [$config]; $wrapper->csrf_token()->willReturn('token_stub'); $wrapper->call(Argument::any(), Argument::any())->willReturn(call_user_func_array([new TestWidgetWithCustomContainer([]), 'run'], [])); $this->testWidgetWithCustomContainer($config)->shouldReturn('<p id="brainkit-widget-container-1" data-id="123">Dummy Content' . '<script type="text/javascript">setTimeout( function() { $(\'#brainkit-widget-container-1\').load(\'/brainkit/load-widget\', ' . $this->mockProduceJavascriptData('TestWidgetWithCustomContainer', $params) . ') }, 10000)</script>' . '</p>'); }