Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
--skip-ci docs
Browse files Browse the repository at this point in the history
Update testing docs
  • Loading branch information
alnutile committed May 5, 2016
1 parent ce286bb commit 9b58611
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,48 @@ There is a dummy route called `/admin/feature_flags/example` that you can visit

This Library pulls in `jowy/feature` and that library has tests. Other than that the there is the settings page which I do have some Laravel tests for that you can run once the package is installed.

Also if you are trying to test the use of it in your work you can use the helper trait in your test class

```php

use DatabaseTransactions, \AlfredNutileInc\LaravelFeatureFlags\FeatureFlagHelper;
```

Then from there factory out your additions and state then reregister the world

```php

/**
* @test
*/
public function should_fail_validation_since_twitter_missing()
{
//Make a form request
//Set validation on that related to twitter field
//make sure the feature flag is on

$user_id = Rhumsaa\Uuid\Uuid::uuid4()->toString();

$user = factory(\App\User::class)->create([
'id' => $user_id,
'is_admin' => 1
]);

$this->actingAs($user);

factory(\AlfredNutileInc\LaravelFeatureFlags\FeatureFlag::class)->create(
[
'key' => 'add-twitter-field',
'variants' => 'on'
]
);

$this->registerFeatureFlags();
////
}

```

<a name=todo></a>
## TODO

Expand Down

0 comments on commit 9b58611

Please sign in to comment.