forked from tempestphp/tempest-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(framework): extend http testing methods (tempestphp#790)
- Loading branch information
Showing
7 changed files
with
352 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tempest\Http; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)] | ||
final class Connect extends Route | ||
{ | ||
public function __construct( | ||
string $uri, | ||
|
||
/** | ||
* @template MiddlewareClass of \Tempest\Http\HttpMiddleware | ||
* @var class-string<MiddlewareClass>[] $middleware | ||
*/ | ||
array $middleware = [], | ||
) { | ||
parent::__construct( | ||
uri: $uri, | ||
method: Method::CONNECT, | ||
middleware: $middleware, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tempest\Http; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)] | ||
final class Head extends Route | ||
{ | ||
public function __construct( | ||
string $uri, | ||
|
||
/** | ||
* @template MiddlewareClass of \Tempest\Http\HttpMiddleware | ||
* @var class-string<MiddlewareClass>[] $middleware | ||
*/ | ||
array $middleware = [], | ||
) { | ||
parent::__construct( | ||
uri: $uri, | ||
method: Method::HEAD, | ||
middleware: $middleware, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tempest\Http; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)] | ||
final class Options extends Route | ||
{ | ||
public function __construct( | ||
string $uri, | ||
|
||
/** | ||
* @template MiddlewareClass of \Tempest\Http\HttpMiddleware | ||
* @var class-string<MiddlewareClass>[] $middleware | ||
*/ | ||
array $middleware = [], | ||
) { | ||
parent::__construct( | ||
uri: $uri, | ||
method: Method::OPTIONS, | ||
middleware: $middleware, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tempest\Http; | ||
|
||
use Attribute; | ||
|
||
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)] | ||
final class Trace extends Route | ||
{ | ||
public function __construct( | ||
string $uri, | ||
|
||
/** | ||
* @template MiddlewareClass of \Tempest\Http\HttpMiddleware | ||
* @var class-string<MiddlewareClass>[] $middleware | ||
*/ | ||
array $middleware = [], | ||
) { | ||
parent::__construct( | ||
uri: $uri, | ||
method: Method::TRACE, | ||
middleware: $middleware, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters