Skip to content

Commit b757490

Browse files
committed
test guard
1 parent 5b264ee commit b757490

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Tracing/Cache/TraceableTagAwareCacheAdapterTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public function testWithSubNamespaceReturnsNamespacedAdapter(): void
6868
}
6969

7070
$decoratedAdapter = new TagAwareAdapter(new ArrayAdapter(), new ArrayAdapter());
71+
if (!\method_exists($decoratedAdapter, 'withSubNamespace')) {
72+
$this->markTestSkipped('TagAwareAdapter::withSubNamespace() is not available in this Symfony version.');
73+
}
7174
$namespacedAdapter = $decoratedAdapter->withSubNamespace('foo');
7275

7376
$adapter = new TraceableTagAwareCacheAdapterForV3WithNamespace($this->hub, $decoratedAdapter);
@@ -97,6 +100,9 @@ public function testNamespaceIsAddedToSpanData(): void
97100
->willReturn($transaction);
98101

99102
$decoratedAdapter = new TagAwareAdapter(new ArrayAdapter(), new ArrayAdapter());
103+
if (!\method_exists($decoratedAdapter, 'withSubNamespace')) {
104+
$this->markTestSkipped('TagAwareAdapter::withSubNamespace() is not available in this Symfony version.');
105+
}
100106
$adapter = new TraceableTagAwareCacheAdapterForV3WithNamespace($this->hub, $decoratedAdapter);
101107

102108
$namespaced = $adapter->withSubNamespace('foo')->withSubNamespace('bar');
@@ -125,6 +131,9 @@ public function testSingleNamespaceIsAddedToSpanData(): void
125131
->willReturn($transaction);
126132

127133
$decoratedAdapter = new TagAwareAdapter(new ArrayAdapter(), new ArrayAdapter());
134+
if (!\method_exists($decoratedAdapter, 'withSubNamespace')) {
135+
$this->markTestSkipped('TagAwareAdapter::withSubNamespace() is not available in this Symfony version.');
136+
}
128137
$adapter = new TraceableTagAwareCacheAdapterForV3WithNamespace($this->hub, $decoratedAdapter);
129138

130139
$namespaced = $adapter->withSubNamespace('foo');

0 commit comments

Comments
 (0)