예제 #1
0
 public function testShouldEnableApacheServer()
 {
     $temporaryDir = 'app/tmp';
     $configRepository = $this->getMockBuilder('Marvin\\Config\\Repository')->setMethods(['get'])->getMock();
     $configRepository->expects($this->once())->method('get')->with($this->equalTo('app.temporary-dir'))->will($this->returnValue($temporaryDir));
     $vhManager = $this->getMockBuilder('Marvin\\Contracts\\HostManager')->setMethods([])->getMock();
     $vhManager->expects($this->once())->method('get')->with($this->equalTo('file-name'))->will($this->returnValue('marvin.dev.conf'));
     $execute = new Execute($configRepository);
     $execute->setHostManager($vhManager);
     $this->assertRegExp('/Enabled Success/', $execute->enable());
     $this->assertRegExp('/sudo a2ensite marvin.dev.conf/', $execute->enable());
 }