tag entity can modify the properties and can persist they

Cette révision appartient à :
2025-01-01 22:27:01 +01:00
Parent 5bb228217b
révision cb494800d2
3 fichiers modifiés avec 53 ajouts et 15 suppressions

Voir le fichier

@ -72,7 +72,7 @@ class TagTest extends IntegrationTestCase
* @covers \D3\KlicktippPhpClient\Resources\Tag::get
* @dataProvider getDataProvider
*/
public function testGet(ResponseInterface $response, ?TagEntity $expected, bool $expectException = false)
public function testGet(ResponseInterface $response, ?array $expected, bool $expectException = false)
{
$sut = new Tag($this->getConnectionMock($response));
@ -80,14 +80,14 @@ class TagTest extends IntegrationTestCase
$this->expectException(BaseException::class);
}
$this->assertEquals(
$expected,
$this->callMethod(
$sut,
'get',
['12514414']
)
$return = $this->callMethod(
$sut,
'get',
['12514414']
);
$this->assertInstanceOf(TagEntity::class, $return);
$this->assertSame($expected, $return->toArray());
}
public static function getDataProvider(): Generator
@ -96,11 +96,11 @@ class TagTest extends IntegrationTestCase
"tagid": "12514414",
"name": "tagName2",
"text": ""
}'), new TagEntity([
}'), [
"tagid" => "12514414",
"name" => "tagName2",
"text" => "",
])];
]];
yield 'unknown id' => [new Response(404, [], '["Kein Tag mit dieser ID."]'), null, true];
yield 'access denied' => [new Response(403, [], '["API Zugriff verweigert"]'), null, true];
}