superreal / srunit Goto Github PK
View Code? Open in Web Editor NEWLibrary containing environment especially for writing unit tests for OXID modules.
License: GNU General Public License v3.0
Library containing environment especially for writing unit tests for OXID modules.
License: GNU General Public License v3.0
Hm, i don't get it running properly.
My oxid version is 4.9.2 CE, is it right to use this version?
i've created a test module, which implement a class (assigns in metadata.php under "files"), extends from oxbase and implements a "foo" function.
if i create a mock from this class, in my test files, i just get a "...::foo() does not exists on this mock object".
maybe im totally stupid, but has anyone an idea?
Add/Implement Util\VirtualFilesystem
(similar to Util\Filesystem
), and remove the createFilesystem()
and createFilesystem()
from TestCase
.
Both of them should implement the same Interface, or extend an AbstractFilesystem
.
When generating code coverage there is fatal errors about non existent parent classes.
Dirty workaround:
Add loadOXID()
to bootstrap.php
in tests folder.
SrUnit\Bootstrap::create(DIR)->loadOXID()->bootstrap();
It's currently not possible to set Mock object names with sRUnit.
Apparently the custom autoloader does not work properly. When a extension for an OXID class should be tested (e.g. oxArticleFoo), this class is not considered to be autoloaded.
metadata.php contains a valid entry in 'extend'.
Please check this.
The general approach to let all tests run in isolation breaks the verification of the defined expectation that should be triggered by TestListener
No clue yet how to make things better. First idea is to drop the global setting above and use the PHPUnit annotation to trigger isolation. Because this is only needed when it comes to alias-mocks.
\SrUnit\Boostrap::create(DIR)->bootstrap(); is wrong
\SrUnit\Boostrap::create(DIR)->bootstrap(); is right
BOOTSTRAP instead BOOSTRAP, 5 living hours head meets wall :)
When I use sR Unit and run phpunit with --coverage-text for instance, I don't want to see Mockery showing up etc.
We can use Factory::createParentClass()
, but this is adding an implicit "_parent" to the classname, because the intention was to mock the OXID-parent classes.
But it would be good to have this feature also availlable for direct extensions of OXID core classes.
Please figure out how to enable such a feature.
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.