inpsyde / wp-stubs Goto Github PK
View Code? Open in Web Editor NEWWordPress stubs
License: MIT License
WordPress stubs
License: MIT License
The stubs does not include WP constants like DAY_IN_SECONDS so we get psalm issues in our PR's
A file with WP defined constants is included into latest.php
havent thought in an alternative
No response
Right now, WP Stubs already covers all those functions that you have to stubs in 90% of the cases, when you write enough unit tests for your code.
However, there are many functions that are not used so often, but still they are used quite enough and same enough to avoid duplication in every unit test setup.
Here's a link of all the functions I've spotted.
Also if this function is very simple and in most of the case the stub only returns a static string, it is used really a lot and in many cases it must be stubbed with a callback usage.
Examples of usage here.
This is used quite often as well, however I see that sometimes it is aliased with a callback very specific to a single test, so maybe it needs to be called in a separate function?
Examples of usage here.
Also if this is one of the less stubbed, I believe we can assume it always will need the same alias, so probably it worth to be centralized as well.
Example of usage here.
This isn't very used neither, but it's very boring to stub if you need to alias it.
Examples of usage here and here.
Again, not used so often but very simple to centralize in my opinion.
I think that one of the important things to decide, in addition to specific aliases, is how to "group" the stubs. Right now, the package provides the functions stubTranslationFunctions()
and stubEscapeFunctions()
and we can assume that if I need one of the functions stubbed there, then I need also the others. However, about the functions named above, I could want a generic alias for certain functions but some specific alias created by me for others, and I am not sure that the package allows to "override" the alias in some way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.