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); }
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); }
public function __construct(array $config = array()) { parent::__construct($config); $this->output = null; $this->error = null; }