Skip to content

Commit 49ee07c

Browse files
committed
Add tests for Widget class
1 parent c7d0c0f commit 49ee07c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/WidgetTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
namespace Tests;
44

5+
use Illuminate\Contracts\Support\Renderable;
6+
use Illuminate\Contracts\Support\Htmlable;
57
use Illuminate\Support\Facades\Response;
68
use Illuminate\Support\Facades\View;
9+
use Imanghafoori\Widgets\Widget;
710

811
class WidgetTest extends TestCase
912
{
@@ -106,6 +109,15 @@ public function test_json_widgets()
106109
$this->assertEquals('123', $a);
107110
}
108111

112+
public function test_widget_renderable_and_htmlable()
113+
{
114+
$widget = new Widget();
115+
$this->assertInstanceOf(Htmlable::class, $widget);
116+
$this->assertInstanceOf(Renderable::class, $widget);
117+
$this->assertEquals('', $widget->toHtml());
118+
$this->assertEquals('', $widget->render());
119+
}
120+
109121
public function test_json_widgets_as_string()
110122
{
111123
Response::shouldReceive('json')->once()->with('222111', 200)->andReturn('123');

0 commit comments

Comments
 (0)