First go at integration tests

This commit is contained in:
Dane Everitt 2018-03-04 16:30:16 -06:00
parent 89db9390df
commit e2aa01c9cc
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
16 changed files with 610 additions and 28 deletions

View file

@ -32,7 +32,13 @@ class LocationTransformer extends BaseTransformer
*/
public function transform(Location $location): array
{
return $location->toArray();
return [
'id' => $location->id,
'short' => $location->short,
'long' => $location->long,
$location->getUpdatedAtColumn() => $this->formatTimestamp($location->updated_at),
$location->getCreatedAtColumn() => $this->formatTimestamp($location->created_at),
];
}
/**
@ -40,6 +46,8 @@ class LocationTransformer extends BaseTransformer
*
* @param \Pterodactyl\Models\Location $location
* @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource
*
* @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException
*/
public function includeServers(Location $location)
{
@ -57,6 +65,8 @@ class LocationTransformer extends BaseTransformer
*
* @param \Pterodactyl\Models\Location $location
* @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource
*
* @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException
*/
public function includeNodes(Location $location)
{