Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for Widget class
Browse files Browse the repository at this point in the history
imanghafoori1 committed Jun 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c7d0c0f commit 8125d4d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/WidgetTest.php
Original file line number Diff line number Diff line change
@@ -2,8 +2,11 @@

namespace Tests;

use Illuminate\Contracts\Support\Renderable;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\View;
use Imanghafoori\Widgets\Widget;

class WidgetTest extends TestCase
{
@@ -106,6 +109,13 @@ public function test_json_widgets()
$this->assertEquals('123', $a);
}

public function test_widget_renderable_and_htmlable()
{
$widget = new Widget();
$this->assertInstanceOf(Htmlable::class, $widget);
$this->assertInstanceOf(Renderable::class, $widget);
}

public function test_json_widgets_as_string()
{
Response::shouldReceive('json')->once()->with('222111', 200)->andReturn('123');

0 comments on commit 8125d4d

Please sign in to comment.