I’m currently building a web application where WordPress is serving as the core framework. I’ve discussed this before and Matt covered this in State of the Word 2012 as something that will become more common as WordPress grows in popularity.
So WordPress doesn’t necessarily have an MVC or MVVM or whatever design pattern, but it offers its own method for how data models, business logic, and other necessary components should be created.
I’m using the Settings API to create a model that represents a user in the application. Essentially, it will wrap the core WordPress user model, but I have to introduce some additional attributes and ultimately create relationships with other models that WordPress doesn’t natively support.
Anyway, I’m writing unit tests for everything that’s going into the application and I hit an interesting point when it came to unit testing the validation functions.