Bolt\Tests\Configuration\ComposerConfigurationTest::testCheckDir PHP Метод

testCheckDir() публичный Метод

public testCheckDir ( )
    public function testCheckDir()
    {
        $fakeLocation = '/path/to/nowhere';
        $config = new Composer(TEST_ROOT);
        $verifier = new ComposerChecks($config);
        $app['resources'] = $config;
        ResourceManager::$theApp = $app;
        // Check we get an exception if the directory isn't writable
        $this->php->expects($this->at(0))->method('is_dir')->will($this->returnValue(true));
        $this->php->expects($this->at(1))->method('is_dir')->will($this->returnValue(true));
        $this->php->expects($this->any())->method('is_writable')->will($this->returnValue(false));
        try {
            $verifier->checkDir($fakeLocation);
            $this->fail('Bolt\\Exception\\BootException not thrown');
        } catch (BootException $e) {
            $message = strip_tags($e->getMessage());
            $this->assertRegExp("/The default folder \\/path\\/to\\/nowhere isn't writable. Make sure it's writable to the user that the web server is using/", $message);
            $this->assertRegExp('/When using Bolt as a Composer package it will need to have access to the following folders/', $message);
            //$this->assertRegExp('/Bolt - Fatal error/', $e::$screen);
        }
    }