subscriber lists are always from same type

Cette révision appartient à :
Daniel Seifert 2025-01-05 14:58:30 +01:00
Parent 2991383f18
révision 19338d2a58
Signé par: DanielS
ID de la clé GPG: 6A513E13AEE66170
2 fichiers modifiés avec 11 ajouts et 9 suppressions

Voir le fichier

@ -220,9 +220,9 @@ class Subscriber extends Model
/** /**
* @throws BaseException * @throws BaseException
*/ */
public function tagged(string $tagId): array public function tagged(string $tagId): SubscriberList
{ {
return $this->connection->requestAndParse( $data = $this->connection->requestAndParse(
'POST', 'POST',
'subscriber/tagged.json', 'subscriber/tagged.json',
[ [
@ -231,6 +231,8 @@ class Subscriber extends Model
], ],
] ]
) ?? []; ) ?? [];
return new SubscriberList($data);
} }
/** /**

Voir le fichier

@ -413,14 +413,14 @@ class SubscriberTest extends IntegrationTestCase
$this->expectException(BaseException::class); $this->expectException(BaseException::class);
} }
$this->assertEquals( $return = $this->callMethod(
$expected,
$this->callMethod(
$sut, $sut,
'tagged', 'tagged',
['2354758'] ['2354758']
)
); );
$this->assertInstanceOf(SubscriberList::class, $return);
$this->assertSame($expected, $return->toArray());
} }
public static function taggedDataProvider(): Generator public static function taggedDataProvider(): Generator