Skip to content

Commit

Permalink
fix: add properties to Subscription/GetStatusResponse class
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioturdo committed Aug 29, 2023
1 parent d10c351 commit 65aabfe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Response/Subscription/GetStatusResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@

class GetStatusResponse extends BaseResponse
{
public ?array $status = null;

public function fillFromArray(array $params, bool $allowExtraProperties = false): void
{
parent::fillFromArray($params, $allowExtraProperties);

$this->status = $params['status'] ?? [];
}
}
20 changes: 20 additions & 0 deletions tests/Response/Subscription/GetStatusResponseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace ImmobiliareLabs\BrazeSDK\Test\Response\Subscription;

use ImmobiliareLabs\BrazeSDK\Response\Subscription\GetStatusResponse;
use PHPUnit\Framework\TestCase;

class GetStatusResponseTest extends TestCase
{
public function testFillFromArray(): void
{
$response = new GetStatusResponse();

$status = ['external_id' => 'status'];

$response->fillFromArray(['status' => $status]);

$this->assertSame($status, $response->status);
}
}

0 comments on commit 65aabfe

Please sign in to comment.