ttiny / phptestr Goto Github PK
View Code? Open in Web Editor NEWA framework and GUI for writing unitests for PHP.
Home Page: http://perennials.github.io/phptestr
A framework and GUI for writing unitests for PHP.
Home Page: http://perennials.github.io/phptestr
Consider the tester may run on a remote machine and in this case it shouldn't attempt to open a browser (with a switch), but it should serve the UI.
Also the backend and the frontend should be separate and talk over sockets so the backend could be on any machine. The backend should still be able to server the php log file to the frontend and it should still run the php scripts in sandboxes.
For example, lets say tests make bunch of requests and save bunch of logs. This is useful information needed for debugging, but should only be displayed in cases of error. So the tests should be able to save some stuff that is available via buttons, and optionally hide these buttons if there is no error. Or alternatively there should be some kind of special dumps that are hidden if there is no error, and in case of error a new button will appear that will reveal the dumps.
This wasn't implemented originally because one may want to keep the stuff in the browser window, but I find that everytime I close the server I want to close the browser tabs too. So it should keep some kind of persistent link with the browser and tell it to close the tabs. Consider there may be cases where the server crashes and closing the tabs is undesirable.
nodejs for sure, maybe browser too - communication with sockets. See also #8 .
Put all phptestr communication with the host on a dedicated socket and all output between the tests will be considered testEcho .
See also #17 .
hljs.tabReplace = ' '; // 4 spaces
Print proper error message for "Error: spawn ENOENT" when the php binary is missing. Actually there is no point of opening the browser if it is missing.
ERROR_LOG
PHP Warning: ../../phptestr/lib/php/run_test_script.php@45
require_once(null): failed to open stream: No such file or directory in /Users/Bobi/Dev/phptestr/lib/php/run_test_script.php on line 45
[19-Aug-2014 14:54:03 Europe/Sofia] PHP Fatal error: require_once(): Failed opening required �null� (include_path=�.:�)
Is it !$cond
or $cond !== true
.
This is probably due to nodejs bug that I was unable to catch.
This causes response.write/end()
to do nothing after several response.write()
calls.
http://ipgoeshere:3355/phptestr?target=../supplier-tester/master&args=gta/master
I tried custom queue without success. I also tried calling write()
manually with lot of data many times and it worked.
function WriteQueueChunk ( towrite ) {
this._towrite = towrite;
this._next = null;
}
function WriteQueue ( response ) {
this._response = response;
this._next = null;
this._last = null;
this._end = null;
this._drained = true;
this._response.on( 'drain', this._onDrain.bind( this ) );
}
WriteQueue.define( {
_onDrain: function () {
this._drained = true;
this._writeNext();
},
_writeNext: function () {
if ( !this._drained ) {
return false;
}
if ( this._next ) {
this._drained = this._response.write.apply( this._response, this._next._towrite );
this._next = this._next._next;
if ( this._next === null ) {
this._last = null;
}
return true;
}
else {
return this._writeEnd();
}
},
_writeEnd: function () {
if ( this._end === null ) {
return false;
}
this._response.end.apply( this._response, this._end._towrite );
this._end = null;
return true;
},
write: function () {
var next = new WriteQueueChunk( arguments );
if ( this._last ) {
this._last._next = next;
this._last = next;
}
else {
this._next = next;
this._last = next;
}
this._writeNext();
},
end: function () {
this._end = new WriteQueueChunk( arguments );
this._writeNext();
}
} );
Node.js is good for streams, processes, etc. I had to build of all of this for PHP. Migrating this to node will take only few hours. Node.js can be started from a shell script and it can serve its own UI and open it automatically in a browser window. Apache is definitely not a dependency I want to have.
Would be nice if the frontend is not so dirty and implemented as a neat app using the same frontend as jsdocgen .
Also:
Sometimes Chrome sends a request to Node.js, but node never receives it and Chrome keeps spinning for very long time. While it is doing so the UI won't work (even in a new tab) and you need to restart Chrome. I can't reproduce it nor I have any idea what could cause this.
When launching the php binary enable via command line args "short tags" and also see if it makes sense to force and is it possible to prevent changes to other important ini settings. If it is possible to prevent these change add the same feature to jsdocgen.
When viewing exceptions and coverage.
}
on them.{}
in stack traces, makes no senseWon't be 100% accurate because xdebug's reports are primitive. Should ignore whitespace lines, bracket lines, function and class definition lines, class property definition lines, class const definition lines. The rest should be somehow usable.
Tests should be able to run without the UI, so testing can be automated in scripts... with some colors and possible logging of all the info that the UI provides.
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.