MDL-11075 Now saving to temp file, then outputting using filelib's readfile_chunked...
[moodle-pu.git] / lib / simpletestlib / eclipse.php
blobabd7251ebbfd1426353295575f10520a14f73512
1 <?php
2 /**
3 * base include file for eclipse plugin
4 * @package SimpleTest
5 * @version $Id$
6 */
7 include_once "xml.php";
8 include_once "invoker.php";
9 include_once "socket.php";
10 class EclipseReporter extends XmlReporter {
11 var $_port;
12 function EclipseReporter($port){
13 $this->_port = $port;
14 $this->XmlReporter();
17 function &createInvoker(&$invoker){
18 $eclinvoker = &new EclipseInvoker($invoker, $this->_port);
19 return $eclinvoker;
22 function paintMethodStart($method) {
23 parent::paintGroupStart($this->_group, $this->_size);
24 parent::paintCaseStart($this->_case);
25 parent::paintMethodStart($method);
28 function paintMethodEnd($method){
29 parent::paintMethodEnd($method);
30 parent::paintCaseEnd($this->_case);
31 parent::paintGroupEnd($this->_group);
35 function paintCaseStart($case){
36 $this->_case = $case;
39 function paintCaseEnd($case){
40 $this->_case = "";
42 function paintGroupStart($group,$size){
43 $this->_group = $group;
45 function paintGroupEnd($group){
46 $this->_group = "";
50 class EclipseInvoker extends SimpleInvokerDecorator{
51 var $_port;
52 function EclipseInvoker(&$invoker,$port) {
53 $this->_port = $port;
54 $this->SimpleInvokerDecorator($invoker);
57 function invoke($method) {
58 ob_start();
59 parent::invoke($method);
60 $output = ob_get_contents();
61 ob_end_clean();
63 $sock = new SimpleSocket("127.0.0.1",$this->_port,5);
64 $sock->write($output);
65 $sock->close();
66 echo $sock->getError();