Skip to content

Commit

Permalink
Laravel Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverearl committed Nov 29, 2024
1 parent 36bcabd commit 1308232
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
38 changes: 19 additions & 19 deletions tests/Feature/AvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
use Nomiai\PhpSdk\Resources\Avatar;

describe('avatars', function (): void {
it('can retrieve an avatar belonging to a nomi', function (): void {
$nomi = $this->nomi();
$image = 'Definitely a 1px webp image';
it('can retrieve an avatar belonging to a nomi', function (): void {
$nomi = $this->nomi();
$image = 'Definitely a 1px webp image';

$api = $this->dummy(
uri: "/v1/nomis/{$nomi->uuid}/avatar",
method: HttpMethod::GET,
status: HttpStatus::OK,
body: $image,
headers: [
'Content-Type' => 'image/webp',
],
);
$api = $this->dummy(
uri: "/v1/nomis/{$nomi->uuid}/avatar",
method: HttpMethod::GET,
status: HttpStatus::OK,
body: $image,
headers: [
'Content-Type' => 'image/webp',
],
);

expect($api->getAvatar($nomi->uuid))
->toBeInstanceOf(Avatar::class)
->avatar->toContain($image)
->and($api->getAvatarFromNomi($nomi))
->toBeInstanceOf(Avatar::class)
->avatar->toContain($image);
});
expect($api->getAvatar($nomi->uuid))
->toBeInstanceOf(Avatar::class)
->avatar->toContain($image)
->and($api->getAvatarFromNomi($nomi))
->toBeInstanceOf(Avatar::class)
->avatar->toContain($image);
});
});
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function dummy(string $uri, string $method, int $status, mixed $body = nu

return new NomiAI(
token: $this->faker->uuid(),
client:new Client(['handler' => HandlerStack::create($handler)]),
client: new Client(['handler' => HandlerStack::create($handler)]),
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Resources/AvatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
})->throws(InvalidArgumentException::class);

it('can be made into an array', function (): void {
$avatar = Avatar::make([$this->faker->uuid()]); // This would normally be a raw webp.
$avatar = Avatar::make([$this->faker->uuid()]); // This would normally be a raw webp.

expect($avatar->toArray())->toEqual(['avatar' => $avatar->avatar]);
expect($avatar->toArray())->toEqual(['avatar' => $avatar->avatar]);
});
4 changes: 2 additions & 2 deletions tests/Unit/Resources/NomiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
uuid: $this->faker->uuid(),
name: $this->faker->name(),
created: new DateTimeImmutable(),
gender: $this->faker->randomElement(Gender::cases()),
gender: $this->faker->randomElement(Gender::cases()),
relationshipType: 'not a valid relationship type',
);
})->throws(InvalidArgumentException::class);
Expand All @@ -33,7 +33,7 @@
uuid: $this->faker->uuid(),
name: $this->faker->name(),
created: new DateTimeImmutable(),
gender: $this->faker->randomElement(Gender::cases()),
gender: $this->faker->randomElement(Gender::cases()),
relationshipType: $this->faker->randomElement(RelationshipType::cases()),
);

Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Resources/ResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Nomiai\PhpSdk\Tests\Fixtures\ResourceFake;

it('can be converted into a json representation', function (): void {
$resource = ResourceFake::make([]);
$json = json_encode($resource);
$resource = ResourceFake::make([]);
$json = json_encode($resource);

expect($json)->toBeJson('{"foo":"bar"}');
expect($json)->toBeJson('{"foo":"bar"}');
});

0 comments on commit 1308232

Please sign in to comment.