processCmd('continue', null); VS($o['output_type'], 'code_loc'); VS(substr($o['file'],-17), 'web_request_t.php'); // The interrupt could stop the loop on either the 'sleep' or the // 'while'. In practice it seems to always hit the 'while', but // either is valid so be safe and allow both. $line_no = $o['line_no']; if (($line_no != 19) && ($line_no != 20)) { throw new TestFailure($line_no, '19 or 20'); } $o = $c->processCmd('print', array('$a')); VS($o['values']['value'], 1); // Break the endless loop in web_request_t.php. $c->processCmd('@', array('$a=0')); } function signal2($c) { // Stop on request and PSP end. $c->processCmd('break', array('end', '/web_request_t.php')); $c->processCmd('break', array('psp', '/web_request_t.php')); $o = $c->processCmd('continue', null); // Should be at request end. // Try to print something bogus. Should be undefined. VS(substr($o['text'], -7, 5), 'ended'); $o = $c->processCmd('print', array('$foo')); VS(substr($o['text'], 23, 23), 'Undefined variable: foo'); $o = $c->processCmd('continue', null); // Should be at psp end. // Try to print something bogus. Should be undefined. VS(substr($o['text'], -7, 5), 'ended'); $o = $c->processCmd('print', array('$foo')); VS(substr($o['text'], 23, 23), 'Undefined variable: foo'); // Tell the test harness that we're done messing with the request, and to // interrupt us one last time. $c->processCmd('break', array('clear', 'all')); sendToHarness('3'); // Wait for an interrupt after the request is done, controlled by test harness $o = $c->processCmd('continue', null); VS($o['output_type'], 'code_loc'); VS($o['file'], ''); } try { signal1($client); signal2($client); echo PASS; } catch (TestFailure $t) { error_log($t); echo FAIL; } catch (Exception $e) { error_log($e); echo FAIL; }