Welcome Guest, Not a member yet? Register   Sign In
Unit testing, code coverage, and undefined functions
#1

I'm not much of a unit tester, but see the value, and feel the need to be proficient at it.

So, because of another thread here on the forum, I thought I'd try to make a little REST class, and unit test it with phpunit.

Code coverage is pretty good, but there are some things that I'm not sure about, and one is phpunit's inability to use the PHP function getallheaders. As a work-around, I just check if the function exists before trying to call it, and during the tests I set the headers manually. I found some explanations online as to why getallheaders isn't available, but assuming it would be under normal circumstances.

I know it's not required to have 100% code coverage, and wondering if this is an instance where it would be appropriate to let it be less than 100%.
Reply


Messages In This Thread
Unit testing, code coverage, and undefined functions - by skunkbad - 07-28-2017, 11:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB