Pantheon\Terminus\UnitTests\Models\EnvironmentTest::testCountDeployableCode PHP Method

testCountDeployableCode() public method

    public function testCountDeployableCode()
    {
        $model = $this->_getModelWithCommits([]);
        $this->assertFalse($model->hasDeployableCode());
        $model = $this->_getModelWithCommits([]);
        $this->assertEquals(0, $model->hasDeployableCode());
        $commits = [['not', 'deployable'], ['also', 'not', 'deployable'], ['live', 'not', 'deployable'], ['dev', 'not', 'deployable']];
        $model = $this->_getModelWithCommits($commits);
        $this->assertFalse($model->hasDeployableCode());
        $model = $this->_getModelWithCommits($commits);
        $this->assertEquals(0, $model->hasDeployableCode());
        $commits = [['not', 'deployable'], ['also', 'not', 'deployable'], ['not-deployable', 'live', 'test'], ['also', 'deployable', 'test']];
        $model = $this->_getModelWithCommits($commits);
        $this->assertTrue($model->hasDeployableCode());
        $model = $this->_getModelWithCommits($commits);
        $this->assertEquals(1, $model->hasDeployableCode());
        $commits = [['not', 'deployable'], ['also', 'not', 'deployable'], ['deployable', 'test'], ['also', 'deployable', 'test']];
        $model = $this->_getModelWithCommits($commits);
        $this->assertTrue($model->hasDeployableCode());
        $model = $this->_getModelWithCommits($commits);
        $this->assertEquals(2, $model->hasDeployableCode());
    }