We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8145d38 commit 93ff3fcCopy full SHA for 93ff3fc
core/testing.md
@@ -81,16 +81,16 @@ abstract class AbstractTest extends ApiTestCase
81
return $this->token;
82
}
83
84
- $response = static::createClient()->request('POST', '/login', ['body' => $body ?: [
+ $response = static::createClient()->request('POST', '/login', ['json' => $body ?: [
85
'username' => 'admin@example.com',
86
'password' => '$3cr3t',
87
]]);
88
89
$this->assertResponseIsSuccessful();
90
- $data = json_decode($response->getContent());
91
- $this->token = $data->access_token;
+ $data = $response->toArray();
+ $this->token = $data['token'];
92
93
- return $data->access_token;
+ return $data['token'];
94
95
96
```
0 commit comments