$request =
new Request([],
[ 'authorName' => 'Author',
'headline' => 'Headline',
'text' => 'Text',
'tocAccepted' => true,
'rating' => 3,
'version' => '1.1.0',
]);
$rating = ReviewStruct::
fromRequest(1,
$request);
static::
assertEquals(1,
$rating->
getExtensionId());
static::
assertEquals('Author',
$rating->
getAuthorName());
static::
assertEquals('Headline',
$rating->
getHeadline());
static::
assertEquals('Text',
$rating->
getText());
static::
assertTrue($rating->
isAcceptGuidelines());
static::
assertEquals(3,
$rating->
getRating());
static::
assertEquals('1.1.0',
$rating->
getVersion());
} public function testFromRequestThrowsIfAuthorNameIsInvalid(): void
{ $request =
new Request([],
[