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

Add test for array_diff() #4

Open
3 tasks
andrerademacher opened this issue Oct 11, 2021 · 0 comments
Open
3 tasks

Add test for array_diff() #4

andrerademacher opened this issue Oct 11, 2021 · 0 comments

Comments

@andrerademacher
Copy link
Owner

andrerademacher commented Oct 11, 2021

There are already unit tests for several PHP array functions, but some are still missing.
One of these is array_diff(). Variants like array_diff_xyz() are NOT part of this issue and will be implemented separately.

Examples:
array_merge() >> Unittest array_merge()
array_fill() >> Unittest array_fill()

ToDo:

  • Read the example unit tests for array_merge() and array_fill(). Some edge cases that you will encounter are already solved here.
  • Create a new unit test file zce71/tests/Arrays/ArrayDiffTest.php using the array_merge() example as template.
  • Collect interesting edge cases for array_diff's behaviour and implement these inside the data provider(s).

Hint: The debugger is your friend. Sometimes, one learns to know some surprising "new" behaviour of PHP functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant