'Zend_ProgressBar_Finish'));
$adapter->notify(0, 2, 0.5, 1, 1, 'status');
$output = $adapter->getLastOutput();
$matches = preg_match('##', $output, $result);
$this->assertEquals(1, $matches);
$data = json_decode($result[1], true);
$this->assertEquals(0, $data['current']);
$this->assertEquals(2, $data['max']);
$this->assertEquals(50, $data['percent']);
$this->assertEquals(1, $data['timeTaken']);
$this->assertEquals(1, $data['timeRemaining']);
$this->assertEquals('status', $data['text']);
$adapter->finish();
$output = $adapter->getLastOutput();
$matches = preg_match('##', $output, $result);
$this->assertEquals(1, $matches);
}
}
class Zend_ProgressBar_Adapter_jsPush_Stub extends Zend_ProgressBar_Adapter_jsPush
{
protected $_lastOutput = null;
public function getLastOutput()
{
return $this->_lastOutput;
}
protected function _outputData($data)
{
$this->_lastOutput = $data;
}
}
// Call Zend_ProgressBar_Adapter_jsPushTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "Zend_ProgressBar_Adapter_jsPushTest::main") {
Zend_ProgressBar_Adapter_jsPushTest::main();
}