PhpBench\Environment\Provider\Git::isApplicable PHP Метод

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

public isApplicable ( )
    public function isApplicable()
    {
        if (false === $this->getGitPath()) {
            return false;
        }
        $index = sprintf('%s/.git', getcwd());
        if (file_exists($index)) {
            return true;
        }
        return false;
    }

Usage Example

Пример #1
0
 /**
  * It should not be applicable if GIT is not available.
  */
 public function testNotApplicableIfGitNotFound()
 {
     $exeFinder = $this->prophesize(ExecutableFinder::class);
     $exeFinder->find('git', false)->willReturn(false);
     $provider = new Provider\Git($exeFinder->reveal());
     $this->assertFalse($provider->isApplicable());
 }