mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-24 10:44:55 +08:00
Merge pull request #443 from ewerkema/name
Specify more Postman parameters
This commit is contained in:
@@ -1 +1 @@
|
||||
{"variables":[],"info":{"name":"","_postman_id":"","description":"","schema":"https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json"},"item":[{"name":"Group A","description":"","item":[{"name":"Example title.","request":{"url":"http:\/\/localhost\/api\/test","method":"GET","body":{"mode":"formdata","formdata":[]},"description":"This will be the long description.\nIt can also be multiple lines long.","response":[]}},{"name":"http:\/\/localhost\/api\/responseTag","request":{"url":"http:\/\/localhost\/api\/responseTag","method":"POST","body":{"mode":"formdata","formdata":[]},"description":"","response":[]}}]}]}
|
||||
{"variables":[],"info":{"name":"Laravel API","_postman_id":"","description":"","schema":"https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json"},"item":[{"name":"Group A","description":"","item":[{"name":"Example title.","request":{"url":"http:\/\/localhost\/api\/test","method":"GET","body":{"mode":"formdata","formdata":[]},"description":"This will be the long description.\nIt can also be multiple lines long.","response":[]}},{"name":"http:\/\/localhost\/api\/responseTag","request":{"url":"http:\/\/localhost\/api\/responseTag","method":"POST","body":{"mode":"formdata","formdata":[]},"description":"","response":[]}}]}]}
|
||||
|
||||
1
tests/Fixtures/collection_updated_url.json
Normal file
1
tests/Fixtures/collection_updated_url.json
Normal file
@@ -0,0 +1 @@
|
||||
{"variables":[],"info":{"name":"Laravel API","_postman_id":"","description":"","schema":"https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json"},"item":[{"name":"Group A","description":"","item":[{"name":"Example title.","request":{"url":"http:\/\/yourapp.app\/api\/test","method":"GET","body":{"mode":"formdata","formdata":[]},"description":"This will be the long description.\nIt can also be multiple lines long.","response":[]}},{"name":"http:\/\/yourapp.app\/api\/responseTag","request":{"url":"http:\/\/yourapp.app\/api\/responseTag","method":"POST","body":{"mode":"formdata","formdata":[]},"description":"","response":[]}}]}]}
|
||||
@@ -7,6 +7,7 @@ use RecursiveIteratorIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
use Orchestra\Testbench\TestCase;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Mpociot\ApiDoc\Tests\Fixtures\TestController;
|
||||
use Mpociot\ApiDoc\ApiDocGeneratorServiceProvider;
|
||||
@@ -229,6 +230,22 @@ class GenerateDocumentationTest extends TestCase
|
||||
$this->assertEquals($generatedCollection, $fixtureCollection);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function generated_postman_collection_can_have_custom_url()
|
||||
{
|
||||
Config::set('app.url', 'http://yourapp.app');
|
||||
RouteFacade::get('/api/test', TestController::class.'@withEndpointDescription');
|
||||
RouteFacade::post('/api/responseTag', TestController::class.'@withResponseTag');
|
||||
|
||||
config(['apidoc.routes.0.match.prefixes' => ['api/*']]);
|
||||
$this->artisan('apidoc:generate');
|
||||
|
||||
$generatedCollection = json_decode(file_get_contents(__DIR__.'/../public/docs/collection.json'));
|
||||
$generatedCollection->info->_postman_id = '';
|
||||
$fixtureCollection = json_decode(file_get_contents(__DIR__.'/Fixtures/collection_updated_url.json'));
|
||||
$this->assertEquals($generatedCollection, $fixtureCollection);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function can_append_custom_http_headers()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user