@@ -43,7 +43,7 @@ public function test_it_compiles_server_statement()
4343 $ compiler = new Compiler ();
4444 $ result = $ compiler ->compile ($ str );
4545
46- $ this ->assertSame ($ result , "<?php \$__container->servers(['foo'=> 'bar']); ?> " );
46+ $ this ->assertSame ($ result , "<?php \$__container->servers(['foo' => 'bar']); ?> " );
4747
4848 $ str = <<<'EOL'
4949@servers([
@@ -57,7 +57,7 @@ public function test_it_compiles_server_statement()
5757 $ compiler = new Compiler ();
5858 $ result = $ compiler ->compile ($ str );
5959
60- $ this ->assertSame ($ result , "<?php \$__container->servers(['foo'=>[ 'bar','baz','bah']]); ?> " );
60+ $ this ->assertSame ($ result , "<?php \$__container->servers(['foo' => [ 'bar', 'baz', 'bah' ]]); ?> " );
6161
6262 $ str = <<<'EOL'
6363@servers([
@@ -68,14 +68,33 @@ public function test_it_compiles_server_statement()
6868 $ compiler = new Compiler ();
6969 $ result = $ compiler ->compile ($ str );
7070
71- $ this ->assertSame ($ result , "<?php \$__container->servers(['foo'=> ['bar'],'bar'=> ['baz']]); ?> " );
71+ $ this ->assertSame ($ result , "<?php \$__container->servers(['foo' => ['bar'], 'bar' => ['baz']]); ?> " );
7272
7373 $ str = <<<'EOL'
7474@servers(['foo' => 'bar'])
7575EOL;
7676 $ compiler = new Compiler ();
7777 $ result = $ compiler ->compile ($ str );
7878
79- $ this ->assertSame ($ result , "<?php \$__container->servers(['foo'=>'bar']); ?> " );
79+ $ this ->assertSame ($ result , "<?php \$__container->servers(['foo' => 'bar']); ?> " );
80+ }
81+
82+ public function test_it_compiles_server_statement_with_setup ()
83+ {
84+ $ str = <<<'EOL'
85+ @setup
86+ $user = 'foo';
87+ $server = 'bar';
88+ $port = 22;
89+ @endsetup
90+
91+ @servers([
92+ 'foo' => "{$user}@{$server} -p {$port}"
93+ ])
94+ EOL;
95+ $ compiler = new Compiler ();
96+ $ result = $ compiler ->compile ($ str );
97+
98+ $ this ->assertStringContainsString ('{$user}@{$server} -p {$port} ' , $ result );
8099 }
81100}
0 commit comments