This repository was archived by the owner on Dec 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
test/Faker/Provider/ru_RU Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ class Person extends \Faker\Provider\Person
105
105
'Меркушев ' , 'Лыткин ' , 'Туров ' ,
106
106
);
107
107
108
+ protected static $ lastNameSuffix = array ('a ' , '' );
109
+
108
110
/**
109
111
* Return male middle name
110
112
*
@@ -166,11 +168,13 @@ public function middleName($gender = null)
166
168
public function lastName ($ gender = null )
167
169
{
168
170
$ lastName = static ::randomElement (static ::$ lastName );
169
-
171
+
170
172
if (static ::GENDER_FEMALE === $ gender ) {
171
173
return $ lastName . 'a ' ;
174
+ } elseif (static ::GENDER_MALE === $ gender ) {
175
+ return $ lastName ;
172
176
}
173
-
174
- return $ lastName ;
177
+
178
+ return $ lastName . static :: randomElement ( static :: $ lastNameSuffix ) ;
175
179
}
176
180
}
Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ public function testLastNameFemale()
27
27
28
28
public function testLastNameMale ()
29
29
{
30
- $ this ->assertNotEquals ("a " , substr ($ this ->faker ->lastName (), -1 ));
30
+ $ this ->assertNotEquals ("a " , substr ($ this ->faker ->lastName (' male ' ), -1 ));
31
31
}
32
32
}
You can’t perform that action at this time.
0 commit comments