Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Sep 19, 2023
1 parent df3ed51 commit 4550456
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions tests/Feature/ArrayDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
use Laravel\Pennant\Events\AllFeaturesPurged;
use Laravel\Pennant\Events\FeatureDeleted;
use Laravel\Pennant\Events\FeatureResolved;
use Laravel\Pennant\Events\FeaturesPurged;
use Laravel\Pennant\Events\FeatureUpdated;
use Laravel\Pennant\Events\FeatureUpdatedForAllScopes;
use Laravel\Pennant\Events\FeaturesPurged;
use Laravel\Pennant\Events\UnexpectedNullScopeEncountered;
use Laravel\Pennant\Events\UnknownFeatureResolved;
use Laravel\Pennant\Feature;
use RuntimeException;
use Tests\TestCase;
use Workbench\App\Models\User;

use function Orchestra\Testbench\workbench_path;

class ArrayDriverTest extends TestCase
{
protected function setUp(): void
Expand Down Expand Up @@ -858,13 +860,13 @@ public function test_it_can_set_for_all()
public function test_it_can_auto_register_feature_classes()
{
Feature::define('marketing-design', 'marketing-design-value');
Feature::discover('Tests\\FeatureClasses', __DIR__.'/../FeatureClasses');
Feature::discover('Workbench\\App\\Features', workbench_path('app/Features'));

$all = Feature::all();

$this->assertSame([
'marketing-design' => 'marketing-design-value',
'Tests\\FeatureClasses\\NewApi' => 'new-api-value',
'Workbench\\App\\Features\\NewApi' => 'new-api-value',
], $all);
}

Expand Down
6 changes: 4 additions & 2 deletions tests/Feature/DatabaseDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
use Workbench\App\Models\User;
use Workbench\Database\Factories\UserFactory;

use function Orchestra\Testbench\workbench_path;

class DatabaseDriverTest extends TestCase
{
use RefreshDatabase;
Expand Down Expand Up @@ -1044,13 +1046,13 @@ public function test_it_can_set_for_all()
public function test_it_can_auto_register_feature_classes()
{
Feature::define('marketing-design', 'marketing-design-value');
Feature::discover('Tests\\FeatureClasses', __DIR__.'/../FeatureClasses');
Feature::discover('Workbench\\App\\Features', workbench_path('app/Features'));

$all = Feature::all();

$this->assertSame([
'marketing-design' => 'marketing-design-value',
'Tests\\FeatureClasses\\NewApi' => 'new-api-value',
'Workbench\\App\\Features\\NewApi' => 'new-api-value',
], $all);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests\FeatureClasses;
namespace Workbench\App\Features;

class NewApi
{
Expand Down

0 comments on commit 4550456

Please sign in to comment.