Skip to content

Commit

Permalink
Ignore PHPStan warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chrieinv committed Oct 10, 2023
1 parent 7de4d24 commit c8e9b5b
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,38 @@
use App\H5pLti;
use App\Http\Libraries\LtiTrait;
use App\Http\Requests\LTIRequest;
use Exception;
use Illuminate\Http\Request;
use Tests\TestCase;

class LtiTraitTestClass
{
use LtiTrait;

public function __construct(private H5pLti $lti)
/** @phpstan-ignore-next-line */
public function __construct(private readonly H5pLti $lti)
{
}

public function create()
public function create(): string
{
return 'create';
}

public function doShow()
public function doShow(): string
{
return 'doShow';
}

public function edit()
public function edit(): string
{
return 'edit';
}
}

class LtiTraitTest extends TestCase
{
public function setupLti()
public function setupLti(): void
{
$ltiRequest = $this->createMock(LTIRequest::class);

Expand All @@ -51,7 +53,7 @@ public function setupLti()

public function test_ltiShow_exception(): void
{
$this->expectException(\Exception::class);
$this->expectException(Exception::class);
$this->expectExceptionMessage('No valid LTI request');

$class = app(LtiTraitTestClass::class);
Expand All @@ -67,7 +69,7 @@ public function test_ltiShow(): void

public function test_ltiCreate_exception(): void
{
$this->expectException(\Exception::class);
$this->expectException(Exception::class);
$this->expectExceptionMessage('No valid LTI request');

$class = app(LtiTraitTestClass::class);
Expand All @@ -83,7 +85,7 @@ public function test_ltiCreate(): void

public function test_ltiEdit_exception(): void
{
$this->expectException(\Exception::class);
$this->expectException(Exception::class);
$this->expectExceptionMessage('No valid LTI request');

$class = app(LtiTraitTestClass::class);
Expand Down

0 comments on commit c8e9b5b

Please sign in to comment.