Skip to content
Permalink
Browse files

//

  • Loading branch information
rodolfoberrios committed Mar 16, 2020
1 parent 1d683b5 commit 6d1573acd2cedbd4eccb13b903dae6cc080b646f
@@ -1,3 +1,3 @@
{
"phpunit.files": "components/**/Tests/*Test.php"
"phpunit.files": "components/**/*Test.php"
}
@@ -17,6 +17,7 @@
use Chevere\Components\Spec\Interfaces\SpecIndexCacheInterface;
use Chevere\Components\Spec\Interfaces\SpecIndexInterface;

// Add this header to all responses: Link: </spec/api/routes.json>; rel="describedby"
final class SpecIndexCache implements SpecIndexCacheInterface
{
private CacheInterface $cache;
@@ -30,6 +31,5 @@ public function __construct(CacheInterface $cache)

public function put(SpecIndexInterface $spec): void
{
// Add this header to all responses: Link: </spec/api/routes.json>; rel="describedby"
}
}
@@ -15,11 +15,8 @@

use Chevere\Components\Cache\Cache;
use Chevere\Components\Filesystem\Dir;
use Chevere\Components\Filesystem\Interfaces\Dir\DirInterface;
use Chevere\Components\Filesystem\Path;
use Chevere\Components\Http\MethodController;
use Chevere\Components\Http\Methods\GetMethod;
use Chevere\Components\Regex\Regex;
use Chevere\Components\Route\Route;
use Chevere\Components\Route\RouteEndpoint;
use Chevere\Components\Route\RouteName;
@@ -28,15 +25,9 @@
use Chevere\Components\Router\Routeable;
use Chevere\Components\Router\Router;
use Chevere\Components\Router\RouterCache;
use Chevere\Components\Router\RouterGroups;
use Chevere\Components\Router\RouterIndex;
use Chevere\Components\Router\RouterMaker;
use Chevere\Components\Router\RouterNamed;
use Chevere\Components\Router\RouterRegex;
use Chevere\Components\Router\RoutesCache;
use Chevere\Components\Router\Tests\CacheHelper;
use Chevere\Components\Spec\Exceptions\SpecInvalidArgumentException;
use Chevere\Components\Spec\SpecIndexCache;
use Chevere\TestApp\App\Controllers\TestController;
use PHPUnit\Framework\TestCase;

@@ -11,20 +11,18 @@

declare(strict_types=1);

namespace Chevere\Components\Spec\Tests;
namespace Chevere\Components\Spec\Specs\Tests;

use Chevere\Components\Http\Methods\GetMethod;
use Chevere\Components\Route\Route;
use Chevere\Components\Route\RouteEndpoint;
use Chevere\Components\Route\RouteName;
use Chevere\Components\Route\RoutePath;
use Chevere\Components\Router\Routeable;
use Chevere\Components\Router\RouteableObjectsRead;
use Chevere\Components\Spec\GroupSpec;
use Chevere\Components\Spec\RouteableSpec;
use Chevere\TestApp\App\Controllers\TestController;
use PHPUnit\Framework\TestCase;
use SplObjectStorage;

final class GroupsSpecTest extends TestCase
{
@@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Components\Spec\Tests;
namespace Chevere\Components\Spec\Specs\Tests;

use Chevere\Components\Http\Methods\GetMethod;
use Chevere\Components\Route\Route;
@@ -22,7 +22,6 @@
use Chevere\Components\Router\RouteableObjectsRead;
use Chevere\Components\Spec\GroupSpec;
use Chevere\Components\Spec\IndexSpec;
use Chevere\Components\Spec\RouteableSpec;
use Chevere\TestApp\App\Controllers\TestController;
use PHPUnit\Framework\TestCase;
use SplObjectStorage;
@@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Components\Spec\Tests;
namespace Chevere\Components\Spec\Specs\Tests;

use Chevere\Components\Http\Methods\GetMethod;
use Chevere\Components\Route\RouteEndpoint;
@@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Components\Spec\Tests;
namespace Chevere\Components\Spec\Specs\Tests;

use Chevere\Components\Http\Methods\GetMethod;
use Chevere\Components\Route\Route;
@@ -32,12 +32,12 @@ public function testConstruct(): void
$routePath = new RoutePath('/route/path');
$specPath = '/spec/group/' . $routeName->toString() . '/';
$routeSpecPath = $specPath . 'route.json';
$route = new Route($routeName, $routePath);
$method = new GetMethod;
$routeEndpoint = (new RouteEndpoint($method, new TestController))
->withDescription('Test endpoint')
->withParameters(['name' => 'Test name']);
$route = $route->withAddedEndpoint($routeEndpoint);
$route = (new Route($routeName, $routePath))
->withAddedEndpoint($routeEndpoint);
$routeable = new Routeable($route);
$spec = new RouteableSpec($specPath, $routeable);
$specPathJson = $specPath . $method->name() . '.json';

This file was deleted.

0 comments on commit 6d1573a

Please sign in to comment.
You can’t perform that action at this time.