Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[11.x] Fix build failures due to enum collide After adding BackedEnum support to Gate #52683

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions tests/Auth/AuthAccessGateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use PHPUnit\Framework\TestCase;
use stdClass;

include_once 'Enums.php';

class AuthAccessGateTest extends TestCase
{
public function testBasicClosuresCanBeDefined()
Expand Down Expand Up @@ -1541,9 +1543,3 @@ public function create()
throw new AuthorizationException('Not allowed.', 'some_code');
}
}

enum AbilitiesEnum: string
{
case VIEW_DASHBOARD = 'view-dashboard';
case UPDATE = 'update';
}
7 changes: 2 additions & 5 deletions tests/Auth/AuthorizeMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use PHPUnit\Framework\TestCase;
use stdClass;

include_once 'Enums.php';

class AuthorizeMiddlewareTest extends TestCase
{
protected $container;
Expand Down Expand Up @@ -351,8 +353,3 @@ protected function gate()
return $this->container->make(GateContract::class);
}
}

enum AbilitiesEnum: string
{
case VIEW_DASHBOARD = 'view-dashboard';
}
9 changes: 9 additions & 0 deletions tests/Auth/Enums.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Illuminate\Tests\Auth;

enum AbilitiesEnum: string
{
case VIEW_DASHBOARD = 'view-dashboard';
case UPDATE = 'update';
}
Loading