Skip to content

Commit d9ad34c

Browse files
committed
lint
1 parent 1e38928 commit d9ad34c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

tests/DependencyInjection/Compiler/BufferFlushPassTest.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class BufferFlushPassTest extends TestCase
1717
{
1818
/**
1919
* @param Reference[] $services
20+
*
2021
* @return string[]
2122
*/
2223
private function servicesToName(array $services): array
@@ -26,6 +27,20 @@ private function servicesToName(array $services): array
2627
}, $services);
2728
}
2829

30+
/**
31+
* @param Definition $definition
32+
*
33+
* @return string[]
34+
*/
35+
private function argumentToName(Definition $definition): array
36+
{
37+
$argument = $definition->getArgument(0);
38+
$this->assertIsArray($argument);
39+
$this->assertInstanceOf(Reference::class, $argument[0]);
40+
41+
return $this->servicesToName($argument);
42+
}
43+
2944
/**
3045
* Tests that the flusher will only container references to handler that wrap sentry.
3146
*
@@ -41,7 +56,7 @@ public function testProcessWithMultipleHandlers()
4156

4257
(new BufferFlushPass())->process($container);
4358
$definition = $container->getDefinition('sentry.buffer_flusher');
44-
$serviceIds = $this->servicesToName($definition->getArgument(0));
59+
$serviceIds = $this->argumentToName($definition);
4560
$this->assertEquals(['sentry.test.handler'], $serviceIds);
4661
}
4762

@@ -78,7 +93,7 @@ public function testProcessWithMultipleSentryHandlers()
7893

7994
(new BufferFlushPass())->process($container);
8095
$definition = $container->getDefinition('sentry.buffer_flusher');
81-
$serviceIds = $this->servicesToName($definition->getArgument(0));
96+
$serviceIds = $this->argumentToName($definition);
8297
$this->assertEquals(['sentry.test.handler', 'sentry.other.test.handler'], $serviceIds);
8398
}
8499

@@ -98,7 +113,7 @@ public function testProcessWithFakeSentryHandlers()
98113

99114
(new BufferFlushPass())->process($container);
100115
$definition = $container->getDefinition('sentry.buffer_flusher');
101-
$serviceIds = $this->servicesToName($definition->getArgument(0));
116+
$serviceIds = $this->argumentToName($definition);
102117
$this->assertEquals(['sentry.test.handler'], $serviceIds);
103118
}
104119
}

0 commit comments

Comments
 (0)