terminus icon indicating copy to clipboard operation
terminus copied to clipboard

Add functional test for connection mode change verifying correct model information

Open aaronbauman opened this issue 4 years ago • 1 comments

Expected behavior

  • call \Pantheon\Terminus\Models\Environment::changeConnectionMode($mode)
  • \Pantheon\Terminus\Models\Environment::get("connection_mode")
  • expect ::get to return $mode

Actual behavior

  • ::get returns previous mode, even when connection mode was successfully changed remotely

Steps to reproduce the behavior

  • Implement a new terminus command in which connection mode is changed from sftp to git, and back to sftp (or vice versa).
  • The "change back" function fails, because the Environment model property has not been updated

aaronbauman avatar Feb 24 '21 20:02 aaronbauman

Not sure if it's appropriate to set the property inside of ::changeConnectionMode, or use a callback to change it upon resolution of the sub-process.

aaronbauman avatar Feb 24 '21 20:02 aaronbauman