modify subscriber entity and its tests

This commit is contained in:
2025-01-01 22:25:47 +01:00
parent 58ec1b1549
commit 5bb228217b
3 changed files with 941 additions and 129 deletions

View File

@ -32,6 +32,22 @@ use ReflectionException;
*/
class SubscriberTest extends IntegrationTestCase
{
/**
* @test
* @throws ReflectionException
* @covers \D3\KlicktippPhpClient\Resources\Model::__construct
*/
public function testConstruct(): void
{
$connection = $this->getConnectionMock(new Response(200, [], json_encode([])));
$sut = new Subscriber($connection);
$this->assertSame(
$connection,
$this->getValue($sut, 'connection')
);
}
/**
* @test
* @throws ReflectionException
@ -654,4 +670,25 @@ class SubscriberTest extends IntegrationTestCase
['myMailAddress']
);
}
/**
* @test
* @throws ReflectionException
* @covers \D3\KlicktippPhpClient\Resources\Model::convertDataArrayToUrlParameters
*/
public function testConvertDataArrayToUrlParameters()
{
$sut = $this->getMockBuilder(Subscriber::class)
->disableOriginalConstructor()
->getMock();
$this->assertSame(
['fields[field1]' => 'value1'],
$this->callMethod(
$sut,
'convertDataArrayToUrlParameters',
[['field1' => 'value1']]
)
);
}
}