stubSpec = $this->getMock("\Alchemy\Phrasea\Core\Configuration\Application"); $this->stubParser = $this->getMock("\Alchemy\Phrasea\Core\Configuration\Parser\Yaml"); } public function testIsInstalled() { $this->stubSpec->expects($this->any()) ->method("getConfigurationFile") ->will($this->returnValue(true) ); $this->stubSpec->expects($this->any()) ->method("getServiceFile") ->will($this->returnValue(true) ); $this->stubSpec->expects($this->any()) ->method("getConnexionFile") ->will($this->returnValue(true) ); $handler = new Configuration\Handler($this->stubSpec, $this->stubParser); $configuration = new Configuration($handler); $this->assertTrue($configuration->isInstalled()); } public function testNotInstalled() { $this->stubSpec->expects($this->any()) ->method("getConfigurationFile") ->will($this->throwException(new Exception) ); $this->stubSpec->expects($this->any()) ->method("getServiceFile") ->will($this->returnValue(true) ); $this->stubSpec->expects($this->any()) ->method("getConnexionFile") ->will($this->returnValue(true) ); $handler = new Configuration\Handler($this->stubSpec, $this->stubParser); $configuration = new Configuration($handler); $this->assertFalse($configuration->isInstalled()); } }