public function testInput() { $base = LITHIUM_APP_PATH . '/resources/tmp/tests'; $this->skipIf(!is_writable($base), "{$base} is not writable."); $stream = fopen($this->streams['input'], 'w+'); $request = new Request(array('input' => $stream)); $this->assertTrue(is_resource($request->input)); $this->assertEqual($stream, $request->input); $expected = 2; $result = fwrite($request->input, 'ok'); $this->assertEqual($expected, $result); rewind($request->input); $expected = 'ok'; $result = $request->input(); $this->assertEqual($expected, $result); }
public function testInput() { $base = Libraries::get(true, 'resources') . '/tmp/tests'; $this->skipIf(!is_writable($base), "{$base} is not writable."); $stream = fopen($this->streams['input'], 'w+'); $request = new Request(array('input' => $stream)); $this->assertTrue(is_resource($request->input)); $this->assertEqual($stream, $request->input); $this->assertEqual(2, fwrite($request->input, 'ok')); rewind($request->input); $this->assertEqual('ok', $request->input()); }
public function testInput() { $stream = fopen($this->streams['input'], 'w+'); $request = new Request(array('input' => $stream)); $this->assertTrue(is_resource($request->input)); $this->assertEqual($stream, $request->input); $expected = 2; $result = fwrite($request->input, 'ok'); $this->assertEqual($expected, $result); rewind($request->input); $expected = 'ok'; $result = $request->input(); $this->assertEqual($expected, $result); }