@@ -87,21 +87,19 @@ public function testValidator()
8787 $ response ->assertJson ([
8888 'errors ' => [
8989 [
90- 'message ' => 'The foo must be a valid email address. ' ,
9190 'extensions ' => [
9291 'argument ' => 'foo ' ,
93- 'category ' => 'Validate '
9492 ],
9593 ],
9694 [
97- 'message ' => 'The bar must be greater than 42. ' ,
9895 'extensions ' => [
9996 'argument ' => 'bar ' ,
100- 'category ' => 'Validate '
10197 ],
10298 ]
10399 ]
104100 ]);
101+ $ this ->assertStringContainsString ('must be a valid email address. ' , $ response ->json ('errors ' )[0 ]['message ' ]);
102+ $ this ->assertStringContainsString ('must be greater than 42. ' , $ response ->json ('errors ' )[1 ]['message ' ]);
105103
106104 $ this ->assertSame (400 , $ response ->getStatusCode (), $ response ->getContent ());
107105 }
@@ -114,34 +112,31 @@ public function testValidatorMultiple()
114112 [
115113 'extensions ' => [
116114 'argument ' => 'foo ' ,
117- 'category ' => 'Validate '
118115 ],
119116 ],
120117 [
121- 'message ' => 'The foo must be a valid IPv4 address. ' ,
122118 'extensions ' => [
123119 'argument ' => 'foo ' ,
124- 'category ' => 'Validate '
125120 ],
126121 ]
127122 ]
128123 ]);
129124
130- $ this ->assertStringContainsString ('The foo must start with one of the following: 192 ' , $ response ->json ('errors ' )[0 ]['message ' ]);
125+ $ this ->assertStringContainsString ('must start with one of the following: 192 ' , $ response ->json ('errors ' )[0 ]['message ' ]);
126+ $ this ->assertStringContainsString ('must be a valid IPv4 address. ' , $ response ->json ('errors ' )[1 ]['message ' ]);
131127
132128 $ this ->assertSame (400 , $ response ->getStatusCode (), $ response ->getContent ());
133129 $ response = $ this ->json ('POST ' , '/graphql ' , ['query ' => '{ testValidatorMultiple(foo:"192.168.1") } ' ]);
134130 $ response ->assertJson ([
135131 'errors ' => [
136132 [
137- 'message ' => 'The foo must be a valid IPv4 address. ' ,
138133 'extensions ' => [
139134 'argument ' => 'foo ' ,
140- 'category ' => 'Validate '
141135 ],
142136 ]
143137 ]
144138 ]);
139+ $ this ->assertStringContainsString ('must be a valid IPv4 address. ' , $ response ->json ('errors ' )[0 ]['message ' ]);
145140
146141 $ this ->assertSame (400 , $ response ->getStatusCode (), $ response ->getContent ());
147142
@@ -152,12 +147,11 @@ public function testValidatorMultiple()
152147 [
153148 'extensions ' => [
154149 'argument ' => 'foo ' ,
155- 'category ' => 'Validate '
156150 ],
157151 ]
158152 ]
159153 ]);
160- $ this ->assertStringContainsString ('The foo must start with one of the following: 192 ' , $ response ->json ('errors ' )[0 ]['message ' ]);
154+ $ this ->assertStringContainsString ('must start with one of the following: 192 ' , $ response ->json ('errors ' )[0 ]['message ' ]);
161155
162156 $ this ->assertSame (400 , $ response ->getStatusCode (), $ response ->getContent ());
163157
0 commit comments