Skip to content

Commit e91fa82

Browse files
committed
PHP won’t let us have nice things
1 parent 1d13a3e commit e91fa82

File tree

5 files changed

+19
-130
lines changed

5 files changed

+19
-130
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
# Laravel Hooks for Dredd API Testing Framework
22
This package contains a PHP Dredd hook handler which provides a bridge between the [Dredd API Testing Framework](http://dredd.readthedocs.org/en/latest/)
3-
and PHP environment to ease implementation of testing hooks provided by [Dredd](http://dredd.readthedocs.org/en/latest/). Most of the heavy loading is provided by the [ddelnano/dredd-hooks-php](https://github.com/ddelnano/dredd-hooks-php) package.
3+
and PHP environment to ease implementation of testing hooks provided by [Dredd](http://dredd.readthedocs.org/en/latest/). Most of the heavy loading is provided by the [ddelnano/dredd-hooks-php](https://github.com/ddelnano/dredd-hooks-php) package.
4+
5+
## Dredd Setup
6+
In order to inject environment variables and use the full power of Larvel Dredd Hooks, you need to add the following to your `dredd.yml` file (or put in your console arguments).
7+
8+
```yml
9+
# This can be any single file which extends Netsells\Dredd\Kernel
10+
hookfiles: 'tests/dredd/Kernel.php'
11+
12+
language: 'vendor/bin/dredd-hooks-laravel'
13+
server: 'php -S 127.0.0.1:3000 ./vendor/netsells/dredd-hooks-laravel/server.php -t public/'
14+
endpoint: 'http://127.0.0.1:3000'
15+
```

bin/dredd-hooks-laravel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ if (!$loaded) {
3030
);
3131
}
3232

33+
// Laravel will not overwrite existing environment variables, so we'll pull in custom ones here
34+
if (file_exists($basePath . '/.env.dredd')) {
35+
$dotenv = new Dotenv\Dotenv($basePath, '.env.dredd');
36+
$dotenv->overload();
37+
}
38+
3339
// Load Laravel
3440
$app = require $basePath . '/bootstrap/app.php';
3541
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();

composer.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,5 @@
2020
"Netsells\\Dredd\\": "src/"
2121
}
2222
},
23-
"extra": {
24-
"laravel": {
25-
"providers": [
26-
"Netsells\\Dredd\\DreddServiceProvider"
27-
]
28-
}
29-
},
3023
"minimum-stability": "stable"
3124
}

src/Console/Serve.php

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/DreddServiceProvider.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)