-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from slunak/CreateGroupResponse-missing-its-Un…
…itTest-file CreateGroupResponse missing its UnitTest file
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |