Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy name related code from Malaysia Person class to Singapore Person class #507

Open
wants to merge 12 commits into
base: 1.23
Choose a base branch
from

Conversation

ziming
Copy link

@ziming ziming commented Aug 15, 2022

Currently Singapore Person class has no name related methods, which mean that when you call

$this->faker->name()

you will get either Jane Doe or John Doe, this also cause issues when you do $this->faker->unique()->name()

since you only have 2 names in the default Person super class.

Now, Malaysia and Singapore are 2 neighbour countries that share many similarities when it come to person names. Residents of both countries often travel to each other for leisure and work reasons too. Making it a great class for the Singapore Person class to inherit from.

@pimjansen
Copy link

This does not feel right. Both belong to another language so please lets not mix in between. If you want proper names, update the pr to reflect it in the locale itself

@pimjansen pimjansen added needs work enhancement New feature or request labels Aug 16, 2022
@ziming
Copy link
Author

ziming commented Aug 16, 2022

so ur fine with me copying all the name related methods and variables over? which is pretty much everything except the malaysian Id method

or can I hold an instance of the Malaysia person class in the singapore person class and proxy calls to it?

let me know which u prefer and I update the pr

@pimjansen
Copy link

so ur fine with me copying all the name related methods and variables over? which is pretty much everything except the malaysian Id method

or can I hold an instance of the Malaysia person class in the singapore person class and proxy calls to it?

let me know which u prefer and I update the pr

Copy it over since both are seperate languages. For Faker 2.x which is the next major all will consist of language packs so there cant be a mix between those

@ziming
Copy link
Author

ziming commented Aug 16, 2022

Alright, I have copied them over.

@ziming ziming changed the title Make Singapore Person class extends from Malaysia Person class to inherits its names methods Copy name related code from Malaysia Person class to Singapore Person class Aug 16, 2022
@pimjansen
Copy link

Please update the PR according the contribution guidelines. I see no tests at all etc

@ziming
Copy link
Author

ziming commented Aug 16, 2022

oh ok I will copy the tests over too later. am sick now

@pimjansen
Copy link

oh ok I will copy the tests over too later. am sick now

Fine, but also please review the test to see if they are valid. We will review this as new code

@ziming
Copy link
Author

ziming commented Aug 17, 2022

Hi

I just went to the ms_MY Person test file and found that it has no test for it's name methods

https://github.com/FakerPHP/Faker/blob/main/test/Faker/Provider/ms_MY/PersonTest.php

I then went to check a few other related locales since Singapore and Malaysia is largely made up of Chinese, Malays/Muslim, Indians, English/Christian names.

English: (no name tests)
https://github.com/FakerPHP/Faker/blob/main/test/Faker/Provider/en_US/PersonTest.php

https://github.com/FakerPHP/Faker/blob/main/test/Faker/Provider/en_GB/PersonTest.php

Chinese: (no name tests)
https://github.com/FakerPHP/Faker/blob/main/test/Faker/Provider/zh_TW/PersonTest.php

Malay: (no name tests)
https://github.com/FakerPHP/Faker/blob/main/test/Faker/Provider/ms_MY/PersonTest.php

Indian: (no name tests)
https://github.com/FakerPHP/Faker/tree/main/test/Faker/Provider/en_IN

So this mean i have to try write my own tests for the names, which will take longer, hope you don't mind waiting until my covid is over. So it may take longer than this week.

@pimjansen
Copy link

pimjansen commented Aug 17, 2022

No worries! Better to have solid code. Will pin the PR for the time being.

Take care and recover well!

@ziming
Copy link
Author

ziming commented Aug 31, 2022

Hi, added the tests. @pimjansen

@ziming
Copy link
Author

ziming commented Sep 3, 2022

Hmm I should have used assertIsString instead of assertNotEmpty for some of them

Should I change all to use assertIsString or just the ones that may return an empty string?

@ziming
Copy link
Author

ziming commented Sep 10, 2022

Hi @pimjansen I changed the assertions for those where the result might be empty string to assertIsString

@ziming
Copy link
Author

ziming commented Sep 21, 2022

Hi @pimjansen anything else I need to do?

Thank you

@pimjansen
Copy link

pimjansen commented Sep 21, 2022

I did not look yet, currently i am on leave but i will review once im back

@ziming
Copy link
Author

ziming commented Nov 4, 2022

hi @pimjansen hope u enjoyed ur leave. is this okay now?

@bram-pkg
Copy link
Member

bram-pkg commented Dec 5, 2022

For some reason the pipeline is not running. Weird.

@ziming
Copy link
Author

ziming commented Jan 9, 2023

Anything I can do to help resolve that or is that something on the faker team side? @bram-pkg

@bram-pkg
Copy link
Member

You could try making an empty commit.

@ziming
Copy link
Author

ziming commented May 14, 2023

As you can see I tried to make an empty commit but the github actions still did not run

@DvDty
Copy link

DvDty commented May 14, 2023

Seems like the pipeline jobs are queued, but are "awaiting approval from a maintainer"?
Example: https://github.com/FakerPHP/Faker/actions/runs/4766832639

Maybe connected to this: https://github.blog/changelog/2021-04-22-github-actions-maintainers-must-approve-first-time-contributor-workflow-runs/ ?

@bram-pkg
Copy link
Member

image
I do not see an admin approval button.

Please fix the tests for PHP 7.4 and the other pipeline actions

@pimjansen
Copy link

image

I do not see an admin approval button.

Please fix the tests for PHP 7.4 and the other pipeline actions

I approved whehe

@FakerPHP FakerPHP locked and limited conversation to collaborators May 31, 2023
@FakerPHP FakerPHP unlocked this conversation May 31, 2023
Copy link

@pimjansen pimjansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my review changes on the tests

@@ -10,6 +10,96 @@
*/
final class PersonTest extends TestCase
{
public function testFirstNameMaleMalay()
{
self::assertNotEmpty(Person::firstNameMaleMalay());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They will never be empty due to how interfacing works. Please assert actual values with seeding instead.

@localheinz localheinz changed the base branch from 2.0 to 1.23 September 9, 2023 07:26
@localheinz localheinz added this to the 1.23.1 milestone Sep 9, 2023
@localheinz localheinz removed this from the 1.23.1 milestone Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants