Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Tenatious's avatar

PHP Unit Not Catching Wrong Class Name On Dev?

Hi,

So I have a unit test running that is checking for a page redirect and that the page is displaying some text. The test passes on my localhost as I'd expect and I can browse to the page. I noticed however when I uploaded the site to a server and browsed to the page I got a 500 Error and on digging in to it further it turned out I'd use auth:: instead of Auth:: and so I got a class not found error.

How come PHP Unit on my localhost still processes auth:: correctly instead of providing a class error like the production server does? Is there a setting I can do somewhere that makes it process as strictly on my localhost as on the server?

0 likes
5 replies
ftiersch's avatar

What operating system are you using locally?

I've run into this sometimes because I'm working on Windows which doesn't care about case sensitivity for files so autoloading works correctly. Linux however is quite pedantic about it ;-)

Tenatious's avatar

@DIEGOAURINO - Can't say I have. Not sure why that would affect whether auth or Auth works though? Sounds like a case sensitivity issue to me?

diegoaurino's avatar

@TENATIOUS - Since it is working on your (OSX) local machine, I would review your deployment process first.

Look for:

PHP version, LAMP/LEMP configuration, folder permissions, mandatory access controls, and so on.

Please or to participate in this conversation.