public function testSendQueue() { $entity = m::mock('Guzzle\\Http\\Message\\EntityEnclosingRequest'); $entity->shouldReceive('send')->twice(); $http = m::mock('Guzzle\\Http\\Client'); $http->shouldReceive('post')->andReturn($entity)->twice(); $transport = new Guzzle('123', 'hippy', 'rcrowe'); $transport->setHttp($http); $task = new PhingTask(); $project = m::mock('Project'); $project->shouldReceive('getProperty')->with('hipchat.notify')->andReturn(true)->twice(); $project->shouldReceive('getProperty')->with('hipchat.background')->andReturn(Message::BACKGROUND_RANDOM)->twice(); $task->setProject($project); $task->setText('test 1'); $task->setHtml('test 2'); $task->main($transport); }
/** * @expectedException BuildException */ public function testInvalidText() { $task = new PhingTask(); $task->setText(''); }