module-tests | DEPRECATED PHPUnit testing scaffold for CodeIgniter | Unit Testing library
kandi X-RAY | module-tests Summary
kandi X-RAY | module-tests Summary
Not a module itself but a testing scaffold for CodeIgniter 4 modules, ModuleTests makes it easy to setup PHPUnit tests in your modules. To read more on Unit Testing in CodeIgniter 4 visit the User Guide.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of module-tests
module-tests Key Features
module-tests Examples and Code Snippets
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/CodeIgniter4"
}
],
"minimum-stability": "dev",
"require-dev": {
"phpunit/phpunit" : "^7.0",
"mockery/mockery": "^1.0",
"codeigniter4/codeigniter4": "dev-de
Community Discussions
Trending Discussions on module-tests
QUESTION
I'm trying to better understand the how & why of differences between references to an internal module method vs the reference that is created when that same method is exported.
I'm not even sure my terminology is correct, and searching for information has not turned up anything useful.
A simplified example ...I have a simple module that performs some maths:
...ANSWER
Answered 2019-Jul-26 at 20:25What is JavaScript (or some other process?) doing that causes the creation of these two separate references?
The crux of the issue is that exports are properties on an object that contain separate references to functions within the module and you're only spying on function calls made through the exported property on the object. You're not spying on the underlying function itself so calls made directly to the underlying function are not monitored.
In fact, the Javascript language doesn't provide a way to spy on the underlying core function when all you have is a reference to it. Calls to the core function are made through whatever reference you have. Declaring a function creates a symbol and assigns it a reference to the function you declared. Declaring an export for that creates a property on an object and assigns it another reference to the same underlying function.
Spying on the object hooks the function reference in that object (replaces it with a monitoring function) and it can only monitor calls that are made through that object property because only those will actually call the replacement monitoring function.
I'll give you an example using plain objects so you can see what's going on without the added distraction of exports:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install module-tests
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page