Skip to content

Commit

Permalink
test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaselia authored and tomirons committed Feb 17, 2021
1 parent 246305c commit 2c77f95
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 1 deletion.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":44:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:0:{}}}
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"require-dev": {
"orchestra/testbench": "^6.12"
}
}
32 changes: 32 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
44 changes: 44 additions & 0 deletions tests/Feature/ExportPostmanTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace AndreasElia\PostmanGenerator\Tests\Feature;

use Illuminate\Support\Facades\Artisan;

class ExportPostmanTest extends \Tests\TestCase
{
protected function setUp(): void
{
parent::setUp();
}

protected function test_standard_export_works()
{
Artisan::call('export:postman');

// get output

// ensure output contains json x
}

protected function test_bearer_export_works()
{
Artisan::call('export:postman --bearer=1234567890');

// get output

// ensure output contains json x

// ensure output has headers and variable json
}

protected function test_structured_export_works()
{
// set structured to true in config

Artisan::call('export:postman');

// get output

// ensure output contains json x
}
}
11 changes: 11 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace AndreasElia\PostmanGenerator\Tests;

class TestCase extends \Orchestra\Testbench\TestCase
{
protected function getPackageProviders($app)
{
return ['AndreasElia\PostmanGenerator\PostmanGeneratorServiceProvider'];
}
}
Empty file added tests/Unit/.gitkeep
Empty file.

0 comments on commit 2c77f95

Please sign in to comment.