DataSift\Storyplayer\PlayerLib\StoryTeller::startDevice PHP Method

startDevice() public method

public startDevice ( ) : void
return void
    public function startDevice()
    {
        // what are we doing?
        $log = $this->startAction('start the test device');
        // what sort of browser are we starting?
        $deviceDetails = $this->getDeviceDetails();
        // get the adapter
        $adapter = DeviceLib::getDeviceAdapter($deviceDetails);
        // initialise the adapter
        $adapter->init($deviceDetails);
        // start the browser
        $adapter->start($this);
        // remember the adapter
        $this->setDeviceAdapter($adapter);
        // do we have a deviceSetup() phase?
        if (isset($this->story) && $this->story->hasDeviceSetup()) {
            // get the callbacks to call
            $callbacks = $this->story->getDeviceSetup();
            // make the call
            //
            // we do not need to wrap these in a TRY/CATCH block,
            // as we are already running inside one of the story's
            // phases
            foreach ($callbacks as $callback) {
                call_user_func($callback, $this);
            }
        }
        // all done
        $log->endAction();
    }