Skip to content

Commit 463725b

Browse files
committed
Fix wonky var return
1 parent 1f7dc9e commit 463725b

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

‎pkg/enqueue/Tests/Symfony/DependencyInjection/TransportFactoryTest.php‎

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testThrowIfEmptyNameGivenOnConstruction()
3838

3939
public function testShouldAllowAddConfigurationAsStringDsn()
4040
{
41-
$rootNode = $this->getRootNode();
41+
list($tb, $rootNode) = $this->getRootNode();
4242

4343
$rootNode->append(TransportFactory::getConfiguration());
4444

@@ -59,7 +59,7 @@ public function testShouldAllowAddConfigurationAsStringDsn()
5959
*/
6060
public function testShouldAllowAddConfigurationAsDsnWithoutSlashes()
6161
{
62-
$rootNode = $this->getRootNode();
62+
list($tb, $rootNode) = $this->getRootNode();
6363

6464
$rootNode->append(TransportFactory::getConfiguration());
6565

@@ -75,7 +75,7 @@ public function testShouldAllowAddConfigurationAsDsnWithoutSlashes()
7575

7676
public function testShouldSetNullTransportIfNullGiven()
7777
{
78-
$rootNode = $this->getRootNode();
78+
list($tb, $rootNode) = $this->getRootNode();
7979

8080
$rootNode->append(TransportFactory::getConfiguration());
8181

@@ -91,7 +91,7 @@ public function testShouldSetNullTransportIfNullGiven()
9191

9292
public function testShouldSetNullTransportIfEmptyStringGiven()
9393
{
94-
$rootNode = $this->getRootNode();
94+
list($tb, $rootNode) = $this->getRootNode();
9595

9696
$rootNode->append(TransportFactory::getConfiguration());
9797

@@ -107,7 +107,7 @@ public function testShouldSetNullTransportIfEmptyStringGiven()
107107

108108
public function testShouldSetNullTransportIfEmptyArrayGiven()
109109
{
110-
$rootNode = $this->getRootNode();
110+
list($tb, $rootNode) = $this->getRootNode();
111111

112112
$rootNode->append(TransportFactory::getConfiguration());
113113

@@ -123,7 +123,7 @@ public function testShouldSetNullTransportIfEmptyArrayGiven()
123123

124124
public function testThrowIfEmptyDsnGiven()
125125
{
126-
$rootNode = $this->getRootNode();
126+
list($tb, $rootNode) = $this->getRootNode();
127127

128128
$rootNode->append(TransportFactory::getConfiguration());
129129

@@ -135,7 +135,7 @@ public function testThrowIfEmptyDsnGiven()
135135

136136
public function testThrowIfFactoryClassAndFactoryServiceSetAtTheSameTime()
137137
{
138-
$rootNode = $this->getRootNode();
138+
list($tb, $rootNode) = $this->getRootNode();
139139

140140
$rootNode->append(TransportFactory::getConfiguration());
141141

@@ -153,7 +153,7 @@ public function testThrowIfFactoryClassAndFactoryServiceSetAtTheSameTime()
153153

154154
public function testThrowIfConnectionFactoryClassUsedWithFactoryClassAtTheSameTime()
155155
{
156-
$rootNode = $this->getRootNode();
156+
list($tb, $rootNode) = $this->getRootNode();
157157

158158
$rootNode->append(TransportFactory::getConfiguration());
159159

@@ -171,7 +171,7 @@ public function testThrowIfConnectionFactoryClassUsedWithFactoryClassAtTheSameTi
171171

172172
public function testThrowIfConnectionFactoryClassUsedWithFactoryServiceAtTheSameTime()
173173
{
174-
$rootNode = $this->getRootNode();
174+
list($tb, $rootNode) = $this->getRootNode();
175175

176176
$rootNode->append(TransportFactory::getConfiguration());
177177
$processor = new Processor();
@@ -188,7 +188,7 @@ public function testThrowIfConnectionFactoryClassUsedWithFactoryServiceAtTheSame
188188

189189
public function testShouldAllowSetFactoryClass()
190190
{
191-
$rootNode = $this->getRootNode();
191+
list($tb, $rootNode) = $this->getRootNode();
192192

193193
$rootNode->append(TransportFactory::getConfiguration());
194194
$processor = new Processor();
@@ -205,7 +205,7 @@ public function testShouldAllowSetFactoryClass()
205205

206206
public function testShouldAllowSetFactoryService()
207207
{
208-
$rootNode = $this->getRootNode();
208+
list($tb, $rootNode) = $this->getRootNode();
209209

210210
$rootNode->append(TransportFactory::getConfiguration());
211211
$processor = new Processor();
@@ -222,7 +222,7 @@ public function testShouldAllowSetFactoryService()
222222

223223
public function testShouldAllowSetConnectionFactoryClass()
224224
{
225-
$rootNode = $this->getRootNode();
225+
list($tb, $rootNode) = $this->getRootNode();
226226

227227
$rootNode->append(TransportFactory::getConfiguration());
228228
$processor = new Processor();
@@ -239,7 +239,7 @@ public function testShouldAllowSetConnectionFactoryClass()
239239

240240
public function testThrowIfExtraOptionGiven()
241241
{
242-
$rootNode = $this->getRootNode();
242+
list($tb, $rootNode) = $this->getRootNode();
243243

244244
$rootNode->append(TransportFactory::getConfiguration());
245245
$processor = new Processor();
@@ -453,14 +453,19 @@ public function testThrowIfBuildRpcClientCalledButContextServiceDoesNotExist()
453453
$transport->buildRpcClient($container, []);
454454
}
455455

456-
private function getRootNode(): NodeDefinition
456+
/**
457+
* @return [TreeBuilder, NodeDefinition]
458+
*/
459+
private function getRootNode(): array
457460
{
458461
if (method_exists(TreeBuilder::class, 'getRootNode')) {
459462
$tb = new TreeBuilder('foo');
460-
return $tb->getRootNode();
463+
464+
return [$tb, $tb->getRootNode()];
461465
}
462466

463467
$tb = new TreeBuilder();
464-
return $tb->root('foo');
468+
469+
return [$tb, $tb->root('foo')];
465470
}
466471
}

0 commit comments

Comments
 (0)