Skip to content

Commit fd8f1bb

Browse files
committed
updated test
1 parent f00f13b commit fd8f1bb

File tree

1 file changed

+22
-32
lines changed

1 file changed

+22
-32
lines changed

tests/unit/Mage/Review/Model/ReviewTest.php

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -62,49 +62,39 @@ public function testValidate($expectedResult, array $methods): void
6262

6363
public function provideValidateReviewData(): Generator
6464
{
65+
$validReview = [
66+
'getTitle' => 'Great product',
67+
'getDetail' => 'I really liked this product.',
68+
'getNickname' => 'JohnDoe',
69+
'getCustomerId' => 1,
70+
'getEntityId' => 1,
71+
'getStoreId' => 1,
72+
];
73+
6574
yield 'valid data' => [
6675
true,
67-
[
68-
'getTitle' => 'Great product',
69-
'getDetail' => 'I really liked this product.',
70-
'getNickname' => 'JohnDoe',
71-
'getCustomerId' => 1,
72-
'getEntityId' => 1,
73-
'getStoreId' => 1,
74-
],
76+
$validReview,
7577
];
78+
79+
$data = $validReview;
80+
$data['getTitle'] = '';
7681
yield 'missing title' => [
7782
['Review summary can\'t be empty'],
78-
[
79-
'getTitle' => '',
80-
'getDetail' => 'I really liked this product.',
81-
'getNickname' => 'JohnDoe',
82-
'getCustomerId' => 1,
83-
'getEntityId' => 1,
84-
'getStoreId' => 1,
85-
],
83+
$data,
8684
];
85+
86+
$data = $validReview;
87+
$data['getDetail'] = '';
8788
yield 'missing detail' => [
8889
['Review can\'t be empty'],
89-
[
90-
'getTitle' => 'Great product',
91-
'getDetail' => '',
92-
'getNickname' => 'JohnDoe',
93-
'getCustomerId' => 1,
94-
'getEntityId' => 1,
95-
'getStoreId' => 1,
96-
],
90+
$data,
9791
];
92+
93+
$data = $validReview;
94+
$data['getNickname'] = '';
9895
yield 'missing nickname' => [
9996
['Nickname can\'t be empty'],
100-
[
101-
'getTitle' => 'Great product',
102-
'getDetail' => 'I really liked this product.',
103-
'getNickname' => '',
104-
'getCustomerId' => 1,
105-
'getEntityId' => 1,
106-
'getStoreId' => 1,
107-
],
97+
$data,
10898
];
10999
}
110100
}

0 commit comments

Comments
 (0)