|
11 | 11 | class SiteSshCase extends CommandUnishTestCase |
12 | 12 | { |
13 | 13 |
|
14 | | - /** |
15 | | - * Test drush ssh --simulate. No additional bash passed. |
16 | | - */ |
| 14 | + /** |
| 15 | + * Test drush ssh --simulate. No additional bash passed. |
| 16 | + */ |
17 | 17 | public function testInteractive() |
18 | 18 | { |
19 | 19 | if ($this->isWindows()) { |
20 | 20 | $this->markTestSkipped('ssh command not currently available on Windows.'); |
21 | 21 | } |
22 | 22 |
|
23 | 23 | $options = [ |
24 | | - 'simulate' => null, |
| 24 | + 'simulate' => true, |
25 | 25 | ]; |
26 | 26 | $this->drush('ssh', [], $options, 'user@server/path/to/drupal#sitename'); |
27 | 27 | $output = $this->getErrorOutput(); |
28 | 28 | $expected = "[notice] Simulating: ssh -t -o PasswordAuthentication=no user@server 'cd /path/to/drupal && bash -l'"; |
29 | 29 | $this->assertContains($expected, $output); |
30 | 30 | } |
31 | 31 |
|
32 | | - /** |
33 | | - * Test drush ssh --simulate 'date'. |
34 | | - * @todo Run over a site list. drush_sitealias_get_record() currently cannot |
35 | | - * handle a site list comprised of longhand site specifications. |
36 | | - */ |
| 32 | + /** |
| 33 | + * Test drush ssh --simulate 'date'. |
| 34 | + * @todo Run over a site list. drush_sitealias_get_record() currently cannot |
| 35 | + * handle a site list comprised of longhand site specifications. |
| 36 | + */ |
37 | 37 | public function testNonInteractive() |
38 | 38 | { |
39 | 39 | $options = [ |
40 | | - 'cd' => '0', |
41 | | - 'simulate' => null, |
| 40 | + 'cd' => '0', |
| 41 | + 'simulate' => true, |
42 | 42 | ]; |
43 | 43 | $this->drush('ssh', ['date'], $options, 'user@server/path/to/drupal#sitename'); |
44 | 44 | $output = $this->getErrorOutput(); |
45 | 45 | $expected = "ssh -o PasswordAuthentication=no user@server date"; |
46 | 46 | $this->assertContains($expected, $output); |
47 | 47 | } |
48 | 48 |
|
49 | | - /** |
50 | | - * Test drush ssh with multiple arguments (preferred form). |
51 | | - */ |
| 49 | + /** |
| 50 | + * Test drush ssh with multiple arguments (preferred form). |
| 51 | + */ |
52 | 52 | public function testSshMultipleArgs() |
53 | 53 | { |
54 | 54 | $options = [ |
55 | | - 'cd' => '0', |
56 | | - 'simulate' => null, |
| 55 | + 'cd' => '0', |
| 56 | + 'simulate' => true, |
57 | 57 | ]; |
58 | 58 | $this->drush('ssh', ['ls', '/path1', '/path2'], $options, 'user@server/path/to/drupal#sitename'); |
59 | 59 | $output = $this->getSimplifiedErrorOutput(); |
60 | 60 | $expected = "[notice] Simulating: ssh -o PasswordAuthentication=no user@server 'ls /path1 /path2'"; |
61 | 61 | $this->assertContains($expected, $output); |
62 | 62 | } |
63 | 63 |
|
64 | | - /** |
65 | | - * Test drush ssh with multiple arguments (legacy form). |
66 | | - */ |
| 64 | + /** |
| 65 | + * Test drush ssh with multiple arguments (legacy form). |
| 66 | + */ |
67 | 67 | public function testSshMultipleArgsLegacy() |
68 | 68 | { |
69 | | - // @TODO: Bring this back? |
70 | | - $this->markTestSkipped('Legacy ssh form, where first element of commandline contains both program and arguments is not supported.'); |
71 | | - |
72 | 69 | $options = [ |
73 | | - 'cd' => '0', |
74 | | - 'simulate' => null, |
| 70 | + 'cd' => '0', |
| 71 | + 'simulate' => true, |
75 | 72 | ]; |
76 | 73 | $this->drush('ssh', ['ls /path1 /path2'], $options, 'user@server/path/to/drupal#sitename'); |
77 | 74 | $expected = "[notice] Simulating: ssh -o PasswordAuthentication=no user@server 'ls /path1 /path2'"; |
|
0 commit comments