Appears to not be working on Laravel 9
So I forced it into Laravel 9 and now I'm offended that it appears to not work.
...
use MikeFrancis\LaravelUnleash\Facades\Unleash;
use CustomD\UnleashHelpers\Traits\Testing\UsesFeatureFlags;
class NuclearSecretsControllerTest extends TestCase
{
use UsesFeatureFlags;
public function testSomething(): void
{
$flag = 'this_flag_exists_and_is_true';
$this->assertTrue(Unleash::isFeatureEnabled($flag)); // pass
$this->setFeatureDisabled($flag);
$this->assertFalse(Unleash::isFeatureEnabled($flag)); // fail
$flag = 'this_flag_does_not_exist';
$this->setFeatureDisabled($flag);
$this->assertFalse(Unleash::isFeatureEnabled($flag)); // pass
$this->setFeatureEnabled($flag);
$this->assertTrue(Unleash::isFeatureEnabled($flag)); // fail
}
}
I also snooped around and tried different methods for checking the flag, none worked.
Unleash::isFeatureEnabled()
Feature::isFeatureEnabled()
Feature::enabled()
app(Unleash::class)->isFeatureEnabled()
Using:
- laravel/framework: 9.18
- mikefrancis/laravel-unleash: 0.9
I tested by cloning the repo into a local dir, updating the supported illuminate/support
values to include 9.0.
I have not spent time looking into why this does not work.