factory = new AsyncWidgetFactory(new TestApplicationWrapper()); } public function testItCanRunAsyncWidget() { $output = $this->factory->run('testDefaultSlider'); $expected = '
'; $this->assertEquals($expected, $output); } public function testItCanRunAsyncWidgetWithPlaceholder() { $output = $this->factory->run('slider'); $expected = ''; $this->assertEquals($expected, $output); } public function testItCanRunMultipleAsyncWidgets() { $output = $this->factory->run('slider'); $expected = ''; $this->assertEquals($expected, $output); $output = $this->factory->run('testDefaultSlider'); $expected = ''; $this->assertEquals($expected, $output); } public function testItCanRunAsyncWidgetWithAdditionalParams() { $params = [ [], 'parameter', ]; $output = $this->factory->run('testWidgetWithParamsInRun', [], 'parameter'); $expected = ''; $this->assertEquals($expected, $output); } public function testItCanRunAsyncWidgetWithMagicMethod() { $output = $this->factory->slider(); $expected = ''; $this->assertEquals($expected, $output); } public function testItCanRunNestedAsyncWidget() { $output = $this->factory->run('Profile\TestNamespace\TestFeed'); $expected = ''; $this->assertEquals($expected, $output); } public function testItCanRunNestedAsyncWidgetUsingDotNotation() { $output = $this->factory->run('profile.testNamespace.testFeed'); $expected = ''; $this->assertEquals($expected, $output); } public function testItCanRunAsyncWidgetWithoutJquery() { $this->factory->app->config['laravel-widgets.use_jquery_for_ajax_calls'] = false; $output = $this->factory->run('testDefaultSlider'); $expected = ''; $this->assertEquals($expected, $output); } }