@@ -42,8 +42,7 @@ protected function tearDown(): void
4242 */
4343 public function initializeUsesSimpleWorkflowAsDefault (): void
4444 {
45- $ deployment = new Deployment ('Test deployment ' );
46- $ deployment ->setContainer (static ::getKernel ()->getContainer ());
45+ $ deployment = new Deployment (static ::getKernel ()->getContainer (), 'Test deployment ' );
4746 $ deployment ->initialize ();
4847
4948 self ::assertInstanceOf (SimpleWorkflow::class, $ deployment ->getWorkflow ());
@@ -54,8 +53,7 @@ public function initializeUsesSimpleWorkflowAsDefault(): void
5453 */
5554 public function getNodesReturnsNodesFromApplicationsAsSet (): void
5655 {
57- $ deployment = new Deployment ('Test deployment ' );
58- $ deployment ->setContainer (static ::getKernel ()->getContainer ());
56+ $ deployment = new Deployment (static ::getKernel ()->getContainer (), 'Test deployment ' );
5957 $ application1 = new Application ('Test application 1 ' );
6058 $ application2 = new Application ('Test application 2 ' );
6159
@@ -81,8 +79,7 @@ public function getNodesReturnsNodesFromApplicationsAsSet(): void
8179 */
8280 public function constructorCreatesReleaseIdentifier (): void
8381 {
84- $ deployment = new Deployment ('Test deployment ' );
85- $ deployment ->setContainer (static ::getKernel ()->getContainer ());
82+ $ deployment = new Deployment (static ::getKernel ()->getContainer (), 'Test deployment ' );
8683
8784 $ releaseIdentifier = $ deployment ->getReleaseIdentifier ();
8885
@@ -98,7 +95,7 @@ public function initializeIsAllowedOnlyOnce(): void
9895
9996 $ workflow = new SimpleWorkflow ($ this ->prophesize (TaskManager::class)->reveal ());
10097
101- $ deployment = new Deployment ('Test deployment ' );
98+ $ deployment = new Deployment (static :: getKernel ()-> getContainer (), 'Test deployment ' );
10299 $ deployment ->setWorkflow ($ workflow );
103100 $ deployment ->initialize ();
104101
@@ -113,8 +110,7 @@ public function initializeIsAllowedOnlyOnce(): void
113110 */
114111 public function deploymentHasDefaultLockIdentifierIfNoIdentifierIsGiven ($ deploymentLockIdentifier ): void
115112 {
116- $ deployment = new Deployment ('Some name ' , $ deploymentLockIdentifier );
117- $ deployment ->setContainer (static ::getKernel ()->getContainer ());
113+ $ deployment = new Deployment (static ::getKernel ()->getContainer (), 'Some name ' , $ deploymentLockIdentifier );
118114
119115 self ::assertSame ($ deployment ->getReleaseIdentifier (), $ deployment ->getDeploymentLockIdentifier ());
120116 }
@@ -125,7 +121,7 @@ public function deploymentHasDefaultLockIdentifierIfNoIdentifierIsGiven($deploym
125121 public function deploymentHasDefinedLockIdentifier (): void
126122 {
127123 $ deploymentLockIdentifier = 'Deployment lock identifier ' ;
128- $ deployment = new Deployment ('Some name ' , $ deploymentLockIdentifier );
124+ $ deployment = new Deployment (static :: getKernel ()-> getContainer (), 'Some name ' , $ deploymentLockIdentifier );
129125
130126 self ::assertSame ($ deploymentLockIdentifier , $ deployment ->getDeploymentLockIdentifier ());
131127 }
@@ -138,7 +134,7 @@ public function deploymentHasLockIdentifierDefinedByEnvironmentVariable(): void
138134 $ deploymentLockIdentifier = 'Deployment lock identifier ' ;
139135 putenv (sprintf ('SURF_DEPLOYMENT_LOCK_IDENTIFIER=%s ' , $ deploymentLockIdentifier ));
140136
141- $ deployment = new Deployment ('Some name ' );
137+ $ deployment = new Deployment (static :: getKernel ()-> getContainer (), 'Some name ' );
142138
143139 self ::assertSame ($ deploymentLockIdentifier , $ deployment ->getDeploymentLockIdentifier ());
144140 }
@@ -148,7 +144,7 @@ public function deploymentHasLockIdentifierDefinedByEnvironmentVariable(): void
148144 */
149145 public function deploymentContainsRelativeProjectRootPathForApplicationReleasePath (): void
150146 {
151- $ deployment = new Deployment ('Some name ' );
147+ $ deployment = new Deployment (static :: getKernel ()-> getContainer (), 'Some name ' );
152148
153149 $ node = new Node ('Node ' );
154150 $ node ->setDeploymentPath ('/deployment/path ' );
@@ -166,7 +162,7 @@ public function deploymentContainsRelativeProjectRootPathForApplicationReleasePa
166162 */
167163 public function deploymentContainsChangedRelativeProjectRootPathForApplicationReleasePath (): void
168164 {
169- $ deployment = new Deployment ('Some name ' );
165+ $ deployment = new Deployment (static :: getKernel ()-> getContainer (), 'Some name ' );
170166 $ deployment ->setRelativeProjectRootPath ('htdocs ' );
171167
172168 $ node = new Node ('Node ' );
0 commit comments