Skip to content

Conversation

marcprior-ppd
Copy link
Contributor

Overview

I have added in some new mutators (with tests) and begun adding some tests for existing mutators and cast types.

Added

  • Addition mutator (with tests)
  • Subtraction mutator (with tests)
  • Division mutator (with tests)
  • Power of / expontential mutator (with tests)
  • Modulo mutator (with tests)
  • Base conversion mutator (with tests)
  • Multiplication tests
  • Boolean cast type test
  • Date format cast type test

Fixes

  • When running the date cast tests I never got the InvalidArgumentException because of an unknown class error. Removing the translation function __() resolved this for me.

Testing

  • All tests passing on phpunit 9.3

Further considerations

  • We may want to use Faker or similar in the test suite to generate random values to test with.
  • With the Add / Subtract / Divide / Exponential mutators I introduced a behaviour change with additional arguments, compared with how that works with the Multiply mutator. Those new mutators will apply any subsequent arguments provided (rather than just the first). I'll be honest I'm not 100% it will be needed, I was just wondering on a use case where I might want to potentially want to be passing in a constant and then a unique power. If you'd rather this stick to the behaviour of multiply, reject this and I'll correct accordingly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant