Skip to content

Commit

Permalink
Merge pull request #77 from slunak/CreateGroupResponse-missing-its-Un…
Browse files Browse the repository at this point in the history
…itTest-file

CreateGroupResponse missing its UnitTest file
  • Loading branch information
slunak authored Sep 1, 2024
2 parents 3f6d983 + abf0a93 commit eb37cf9
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/Client/Response/CreateGroupResponseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

/**
* This file is part of the Pushover package.
*
* (c) Serhiy Lunak <https://github.com/slunak>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Client\Response;

use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\TestCase;
use Serhiy\Pushover\Client\Response\CreateGroupResponse;

final class CreateGroupResponseTest extends TestCase
{
public function testCanBeConstructed(): CreateGroupResponse
{
$successfulCurlResponse = '{"status":1,"request":"aaaaaaaa-1111-bbbb-2222-cccccccccccc","group":"go4abk17j3itsva6thz99mdudgq2gm"}';
$response = new CreateGroupResponse($successfulCurlResponse);

$this->assertInstanceOf(CreateGroupResponse::class, $response);
$this->assertTrue($response->isSuccessful());
$this->assertSame('aaaaaaaa-1111-bbbb-2222-cccccccccccc', $response->getRequestToken());

return $response;
}

#[Depends('testCanBeConstructed')]
public function testGetGroup(CreateGroupResponse $response): void
{
$group = $response->getGroupKey();
$this->assertSame($group, 'go4abk17j3itsva6thz99mdudgq2gm');
}
}

0 comments on commit eb37cf9

Please sign in to comment.