Horde_Kolab_Server_Integration_Scenario::runGiven PHP Méthode

runGiven() public méthode

Handle a "given" step.
public runGiven ( &$world, string $action, array $arguments ) : mixed
$action string The description of the step.
$arguments array Additional arguments to the step.
Résultat mixed The outcome of the step.
    public function runGiven(&$world, $action, $arguments)
    {
        switch ($action) {
            case 'several injectors':
                foreach ($this->getEnvironments() as $environment) {
                    $this->prepareInjector($environment);
                }
                break;
            case 'several Kolab servers':
            case 'the test environments':
                $this->initializeEnvironments();
                break;
            case 'an empty Kolab server':
                $world['server'] = $this->prepareKolabServer(self::ENVIRONMENT_MOCK);
                break;
            case 'a basic Kolab server':
                $world['server'] = $this->prepareBasicKolabServer($world);
                break;
            default:
                return $this->notImplemented($action);
        }
    }

Usage Example

Exemple #1
0
 /**
  * Handle a "given" step.
  *
  * @param array  &$world    Joined "world" of variables.
  * @param string $action    The description of the step.
  * @param array  $arguments Additional arguments to the step.
  *
  * @return mixed The outcome of the step.
  */
 public function runGiven(&$world, $action, $arguments)
 {
     switch ($action) {
         case 'an empty Kolab storage':
             $world['storage'] = $this->prepareEmptyKolabStorage();
             break;
         case 'a Kolab setup':
             $result = $this->prepareKolabSetup();
             $world['server'] =& $result['server'];
             $world['storage'] =& $result['storage'];
             $world['auth'] =& $result['auth'];
             break;
         case 'a populated Kolab setup':
             $result = $this->prepareBasicSetup();
             $world['server'] =& $result['server'];
             $world['storage'] =& $result['storage'];
             $world['auth'] =& $result['auth'];
             break;
         default:
             return parent::runGiven($world, $action, $arguments);
     }
 }