Pantheon\Terminus\Models\Workflow::getStatus PHP Méthode

getStatus() public méthode

Returns the status of this workflow
public getStatus ( ) : string
Résultat string
    public function getStatus()
    {
        $status = 'running';
        if ($this->isFinished()) {
            $status = 'failed';
            if ($this->isSuccessful()) {
                $status = 'succeeded';
            }
        }
        return $status;
    }

Usage Example

 public function testStatus()
 {
     $this->assertEquals('running', $this->workflow->getStatus());
     $this->assertEquals(false, $this->workflow->isSuccessful());
     $this->assertEquals(false, $this->workflow->isFinished());
     $this->workflow->set('result', 'succeeded');
     $this->assertEquals('succeeded', $this->workflow->getStatus());
     $this->assertEquals(true, $this->workflow->isSuccessful());
     $this->assertEquals(true, $this->workflow->isFinished());
     $this->workflow->set('result', 'failed');
     $this->assertEquals('failed', $this->workflow->getStatus());
     $this->assertEquals(false, $this->workflow->isSuccessful());
     $this->assertEquals(true, $this->workflow->isFinished());
 }