createStreamFromResource($handle); $h = new Headers(); foreach ($headers as $name => $value) { $h->addHeader($name, $value); } return new SlimRequest( $method, $uri, $h, $cookies, $serverParams, $stream ); } /** * Quickly generate a User new User entity for testing. * * @param array $user The User properties to call User:fromArray on * @return User a new User entity */ protected function getUserFromArray(array $user = []): User { if (empty($user)) { $user = [ 'email' => 'dave@slovocast.com', 'name' => 'Dave SH', 'password' => 'hashed_password' ]; } return User::fromArray($user); } }