@@ -55,7 +55,7 @@ public function createsSymlinkInConfiguredBasePath(): void
55
55
{
56
56
$ options = [
57
57
'symlinks ' => ['media ' => '../media ' ],
58
- 'genericSymlinksBaseDir ' => '/home/foobar/data '
58
+ 'genericSymlinksBaseDir ' => '/home/foobar/data ' ,
59
59
];
60
60
$ this ->task ->execute ($ this ->node , $ this ->application , $ this ->deployment , $ options );
61
61
@@ -70,7 +70,7 @@ public function createsSymlinkInConfiguredBasePath(): void
70
70
public function doNotTryToCreateSymlinksIfOptionIsSetToFalse (): void
71
71
{
72
72
$ options = [
73
- 'createNonExistingSharedDirectories ' => false
73
+ 'createNonExistingSharedDirectories ' => false ,
74
74
];
75
75
$ this ->task ->execute ($ this ->node , $ this ->application , $ this ->deployment , $ options );
76
76
@@ -98,4 +98,45 @@ public function createsMultipleSymlinks(): void
98
98
$ this ->assertCommandExecuted ('ln -s ../log log ' );
99
99
$ this ->assertCommandExecuted ('ln -s ../var var ' );
100
100
}
101
+
102
+ /**
103
+ * @test
104
+ */
105
+ public function createsMultipleDeepSymlinks (): void
106
+ {
107
+ $ options = [
108
+ 'symlinks ' => [
109
+ 'var/log ' => '../../../shared/var/log ' ,
110
+ 'var/temp ' => '/tmp ' ,
111
+ ],
112
+ ];
113
+ $ this ->task ->execute ($ this ->node , $ this ->application , $ this ->deployment , $ options );
114
+
115
+ $ this ->assertCommandExecuted ("cd {$ this ->deployment ->getApplicationReleasePath ($ this ->node )}" );
116
+ $ this ->assertCommandExecuted ('test -e ../../shared/var/log || mkdir -p ../../shared/var/log ' );
117
+ $ this ->assertCommandExecuted ('ln -s ../../../shared/var/log var/log ' );
118
+ $ this ->assertCommandExecuted ('test -e /tmp || mkdir -p /tmp ' );
119
+ $ this ->assertCommandExecuted ('ln -s /tmp var/temp ' );
120
+ }
121
+
122
+ /**
123
+ * @test
124
+ */
125
+ public function createsMultipleDeepSymlinksWithDifferentBaseDir (): void
126
+ {
127
+ $ options = [
128
+ 'symlinks ' => [
129
+ 'var/log ' => '../../../shared/var/log ' ,
130
+ 'var/temp ' => '/tmp ' ,
131
+ ],
132
+ 'genericSymlinksBaseDir ' => '/home/foobar/data ' ,
133
+ ];
134
+ $ this ->task ->execute ($ this ->node , $ this ->application , $ this ->deployment , $ options );
135
+
136
+ $ this ->assertCommandExecuted ('cd /home/foobar/data ' );
137
+ $ this ->assertCommandExecuted ('test -e ../../shared/var/log || mkdir -p ../../shared/var/log ' );
138
+ $ this ->assertCommandExecuted ('ln -s ../../../shared/var/log var/log ' );
139
+ $ this ->assertCommandExecuted ('test -e /tmp || mkdir -p /tmp ' );
140
+ $ this ->assertCommandExecuted ('ln -s /tmp var/temp ' );
141
+ }
101
142
}
0 commit comments