Testing Magic Methods in PHP UNIT

Asked

Viewed 42 times

0

Hello. I need to test the magic methods in PHP UNIT. I’m using the Slim Framework

That it’s them

__set()
__get()
__construct()
__invoke()
handle()
  • You know what everyone does?

  • https://stackoverflow.com/questions/13148669/unit-testing-magic-methods

  • It is not enough to make the use as if it were to be used in a real application, since unit testing usually expects the execution behavior as it would be done in the application, but with all possibilities, then the test for __set would be to do something like $obj->foo = true? Isn’t that right? Or did I make a mistake?

  • I know what each one does, now the unitary tests in phpunit are difficult.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.