error() public method

Writes string to error stream
public error ( string $error ) : mixed
$error string
return mixed
Esempio n. 1
0
 public function testError()
 {
     $base = Libraries::get(true, 'resources') . '/tmp/tests';
     $this->skipIf(!is_writable($base), "Path `{$base}` is not writable.");
     $response = new Response(array('error' => fopen($this->streams['error'], 'w+')));
     $this->assertInternalType('resource', $response->error);
     $this->assertEqual(2, $response->error('ok'));
     $this->assertEqual('ok', file_get_contents($this->streams['error']));
 }
 public function testError()
 {
     $response = new Response(array('error' => fopen($this->streams['error'], 'w+')));
     $this->assertTrue(is_resource($response->error));
     $expected = 2;
     $result = $response->error('ok');
     $this->assertEqual($expected, $result);
     $expected = 'ok';
     $result = file_get_contents($this->streams['error']);
     $this->assertEqual($expected, $result);
 }
Esempio n. 3
0
 public function testError()
 {
     $base = LITHIUM_APP_PATH . '/resources/tmp/tests';
     $this->skipIf(!is_writable($base), "{$base} is not writable.");
     $response = new Response(array('error' => fopen($this->streams['error'], 'w+')));
     $this->assertTrue(is_resource($response->error));
     $expected = 2;
     $result = $response->error('ok');
     $this->assertEqual($expected, $result);
     $expected = 'ok';
     $result = file_get_contents($this->streams['error']);
     $this->assertEqual($expected, $result);
 }