modify subscriber entity and its tests
This commit is contained in:
@ -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']]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user