Skip to content

Commit 496d149

Browse files
committed
Use a valid laravel 5.7 rule for unit test
1 parent 4ae1401 commit 496d149

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/Fixtures/App/Http/Controllers/TestController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testValidator(string $foo, int $bar): string
4949

5050
/**
5151
* @Query()
52-
* @Validate(for="foo", rule="starts_with:abc|ends_with:xyz")
52+
* @Validate(for="foo", rule="starts_with:192|ipv4")
5353
*/
5454
public function testValidatorMultiple(string $foo): string
5555
{

tests/Providers/GraphQLiteServiceProviderTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,18 @@ public function testValidator()
106106

107107
public function testValidatorMultiple()
108108
{
109-
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"xyzabc") }']);
109+
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"191.168.1") }']);
110110
$response->assertJson([
111111
'errors' => [
112112
[
113-
'message' => 'The foo must start with one of the following: abc',
113+
'message' => 'The foo must start with one of the following: 192',
114114
'extensions' => [
115115
'argument' => 'foo',
116116
'category' => 'Validate'
117117
],
118118
],
119119
[
120-
'message' => 'The foo must end with one of the following: xyz',
120+
'message' => 'The foo must be a valid IPv4 address.',
121121
'extensions' => [
122122
'argument' => 'foo',
123123
'category' => 'Validate'
@@ -127,11 +127,11 @@ public function testValidatorMultiple()
127127
]);
128128

129129
$this->assertSame(400, $response->getStatusCode(), $response->getContent());
130-
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"abcdef") }']);
130+
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"192.168.1") }']);
131131
$response->assertJson([
132132
'errors' => [
133133
[
134-
'message' => 'The foo must end with one of the following: xyz',
134+
'message' => 'The foo must be a valid IPv4 address.',
135135
'extensions' => [
136136
'argument' => 'foo',
137137
'category' => 'Validate'
@@ -143,11 +143,11 @@ public function testValidatorMultiple()
143143
$this->assertSame(400, $response->getStatusCode(), $response->getContent());
144144

145145
$this->assertSame(400, $response->getStatusCode(), $response->getContent());
146-
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"uvwxyz") }']);
146+
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"191.168.1.1") }']);
147147
$response->assertJson([
148148
'errors' => [
149149
[
150-
'message' => 'The foo must start with one of the following: abc',
150+
'message' => 'The foo must start with one of the following: 192',
151151
'extensions' => [
152152
'argument' => 'foo',
153153
'category' => 'Validate'
@@ -158,7 +158,7 @@ public function testValidatorMultiple()
158158

159159
$this->assertSame(400, $response->getStatusCode(), $response->getContent());
160160

161-
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"abcxyz") }']);
161+
$response = $this->json('POST', '/graphql', ['query' => '{ testValidatorMultiple(foo:"192.168.1.1") }']);
162162
$this->assertSame(200, $response->getStatusCode(), $response->getContent());
163163
}
164164
}

0 commit comments

Comments
 (0)