Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 public function testQueue()
 {
     $task = new PhingTask();
     $this->assertEquals(get_class($task->createQueue()), 'rcrowe\\Hippy\\PhingTask');
 }
Ejemplo n.º 3
0
 public function testProjectSetBackground()
 {
     $task = new PhingTask();
     $project = m::mock('Project');
     $project->shouldReceive('getProperty')->with('hipchat.background')->andReturn(Message::BACKGROUND_PURPLE)->once();
     $task->setProject($project);
     $this->assertEquals($task->getBackground(), Message::BACKGROUND_PURPLE);
 }