2 If $stdin property is not null, it will be cast to string prior to being passed in
7 require_once dirname(__FILE__) . '/../_setup.inc';
9 $filename = dirname(__FILE__) . '/foobar.php';
11 $fp = fopen("php://stdin", "r");
12 echo fread($fp, 8192);
15 file_put_contents($filename, $code);
18 private $message = '';
19 public function __construct() {
20 $this->message = 'Some Random Int Passed Through STDIN: ' . rand(100, 200);
22 public function __toString() {
23 return $this->message;
27 $message = new FoobarStdin();
29 $runner = new PHPT_CodeRunner();
30 $runner->stdin = $message;
31 $result = $runner->run($filename);
33 assert('$result->output == (string)$message');
38 <?php @unlink(dirname(__FILE__) . '/foobar.php'); ?>