/**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage You cannot have two main applications.
  */
 public function testRegisterMainApplicationTwice()
 {
     $this->mainApplication->expects($this->once())->method('getName')->will($this->returnValue('foo'));
     $this->mainApplication->expects($this->once())->method('buildContainer');
     $repository = new ApplicationRepository($this->dispatcher);
     $repository->register($this->mainApplication);
     $repository->register($this->mainApplication);
 }