Skip to content

Commit

Permalink
Merge branch 'master' into use_pint
Browse files Browse the repository at this point in the history
  • Loading branch information
hotmeteor committed Jan 17, 2024
2 parents 6ade96f + 6b531a9 commit 2b65788
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 131 deletions.
30 changes: 15 additions & 15 deletions _ide_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
/**
* @see \Spectator\Assertions
*
* @method static assertValidRequest()
* @method static assertInvalidRequest()
* @method static assertValidResponse($status = null)
* @method static assertInvalidResponse($status = null)
* @method static assertValidationMessage($expected)
* @method static assertErrorsContain($errors)
* @method static dumpSpecErrors()
* @method static void skipRequestValidation()
* @method static assertValidRequest()
* @method static assertInvalidRequest()
* @method static assertValidResponse($status = null)
* @method static assertInvalidResponse($status = null)
* @method static assertValidationMessage($expected)
* @method static assertErrorsContain($errors)
* @method static dumpSpecErrors()
* @method static void skipRequestValidation()
*/
class TestResponse
{
Expand All @@ -27,13 +27,13 @@ class TestResponse
/**
* @see \Spectator\Assertions
*
* @method static assertValidRequest()
* @method static assertInvalidRequest()
* @method static assertValidResponse($status = null)
* @method static assertInvalidResponse($status = null)
* @method static assertValidationMessage($expected)
* @method static assertErrorsContain($errors)
* @method static void skipRequestValidation()
* @method static assertValidRequest()
* @method static assertInvalidRequest()
* @method static assertValidResponse($status = null)
* @method static assertInvalidResponse($status = null)
* @method static assertValidationMessage($expected)
* @method static assertErrorsContain($errors)
* @method static void skipRequestValidation()
*/
class TestResponse
{
Expand Down
12 changes: 6 additions & 6 deletions config/spectator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@

'sources' => [
'local' => [
'source' => 'local',
'source' => 'local',
'base_path' => env('SPEC_PATH'),
],

'remote' => [
'source' => 'remote',
'source' => 'remote',
'base_path' => env('SPEC_PATH'),
'params' => env('SPEC_URL_PARAMS', ''),
'params' => env('SPEC_URL_PARAMS', ''),
],

'github' => [
'source' => 'github',
'source' => 'github',
'base_path' => env('SPEC_GITHUB_PATH'),
'repo' => env('SPEC_GITHUB_REPO'),
'token' => env('SPEC_GITHUB_TOKEN'),
'repo' => env('SPEC_GITHUB_REPO'),
'token' => env('SPEC_GITHUB_TOKEN'),
],
],

Expand Down
2 changes: 1 addition & 1 deletion src/Assertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function assertErrorsContain()
return fn ($errors) => $this->runAssertion(function () use ($errors) {
$matches = 0;

if (! is_array($errors)) {
if (!is_array($errors)) {
$errors = [$errors];
}

Expand Down
28 changes: 14 additions & 14 deletions src/Spectator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
use Illuminate\Support\Facades\Facade;

/**
* @method static void using($name) Set the spec file to use.
* @method static void reset() Reset the name of the spec.
* @method static string getSpec() Get the spec being used.
* @method static string getPathPrefix() Get the path prefix being used.
* @method static RequestFactory setPathPrefix($prefix) Set the path prefix being used.
* @method static object resolve() Resolve the spec into an object.
* @method bool shouldValidateRequest() Indicate if request should be validated.
* @method static void using($name) Set the spec file to use.
* @method static void reset() Reset the name of the spec.
* @method static string getSpec() Get the spec being used.
* @method static string getPathPrefix() Get the path prefix being used.
* @method static RequestFactory setPathPrefix($prefix) Set the path prefix being used.
* @method static object resolve() Resolve the spec into an object.
* @method bool shouldValidateRequest() Indicate if request should be validated.
*
* @see \Spectator\RequestFactory
*/
class Spectator extends Facade
{
/**
* @method static void using($name) Set the spec file to use.
* @method static void reset() Reset the name of the spec.
* @method static string getSpec() Get the spec being used.
* @method static string getPathPrefix() Get the path prefix being used.
* @method static RequestFactory setPathPrefix($prefix) Set the path prefix being used.
* @method static object resolve() Resolve the spec into an object.
* @method bool shouldValidateRequest() Indicate if request should be validated.
* @method static void using($name) Set the spec file to use.
* @method static void reset() Reset the name of the spec.
* @method static string getSpec() Get the spec being used.
* @method static string getPathPrefix() Get the path prefix being used.
* @method static RequestFactory setPathPrefix($prefix) Set the path prefix being used.
* @method static object resolve() Resolve the spec into an object.
* @method bool shouldValidateRequest() Indicate if request should be validated.
*
* @see \Spectator\RequestFactory
*/
Expand Down
14 changes: 7 additions & 7 deletions tests/AssertionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function test_asserts_invalid_path()
Route::get('/invalid', function () {
return [
[
'id' => 1,
'name' => 'Jim',
'id' => 1,
'name' => 'Jim',
'email' => '[email protected]',
],
];
Expand All @@ -46,8 +46,8 @@ public function test_fails_asserts_invalid_path()
Route::get('/invalid', function () {
return [
[
'id' => 1,
'name' => 'Jim',
'id' => 1,
'name' => 'Jim',
'email' => '[email protected]',
],
];
Expand All @@ -65,8 +65,8 @@ public function test_fails_asserts_invalid_path_without_exception_handling()
Route::get('/invalid', function () {
return [
[
'id' => 1,
'name' => 'Jim',
'id' => 1,
'name' => 'Jim',
'email' => '[email protected]',
],
];
Expand Down Expand Up @@ -106,7 +106,7 @@ public function test_request_assertion_does_not_format_laravel_validation_respon
})->middleware(Middleware::class);

$response = $this->postJson('/users', [
'name' => 'Jane Doe',
'name' => 'Jane Doe',
'email' => '[email protected]',
]);

Expand Down
4 changes: 2 additions & 2 deletions tests/MiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public function test_only_processes_request_once(): void

return [
[
'id' => 1,
'name' => 'Jim',
'id' => 1,
'name' => 'Jim',
'email' => '[email protected]',
],
];
Expand Down
Loading

0 comments on commit 2b65788

Please sign in to comment.