Skip to content

Commit 88c595d

Browse files
committed
improved testing and cache-related patch file
1 parent 1ab3f77 commit 88c595d

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

features/setup/symfonyCache.feature

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,24 @@ Subject: [PATCH] Enabled Symfony Reverse Proxy
1414
1 file changed, 6 insertions(+), 1 deletion(-)
1515
1616
diff --git a/public/index.php b/public/index.php
17-
index 9982c21..03ac40a 100644
1817
--- a/public/index.php
1918
+++ b/public/index.php
2019
@@ -1,9 +1,14 @@
2120
<?php
22-
21+
2322
use App\Kernel;
2423
+use Ibexa\Bundle\HttpCache\AppCache;
2524
+use Symfony\Component\HttpFoundation\Request;
26-
25+
2726
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
28-
27+
2928
return function (array $context) {
3029
- return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
3130
+ $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
3231
+ Request::enableHttpMethodParameterOverride();
3332
+
3433
+ return new AppCache($kernel);
3534
};
36-
--
35+
--
3736
2.30.0
3837
"""

src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function supports(mixed $value): bool
2626

2727
public function tag(mixed $value)
2828
{
29-
/** @var \Ibexa\Core\MVC\Symfony\View\ContentValueView $value */
30-
$content = $value->getContent();
29+
assert($value instanceof ContentValueView);
3130

32-
$contentInfo = $content->getVersionInfo()->getContentInfo();
33-
$this->contentInfoTagger->tag($contentInfo);
31+
$this->contentInfoTagger->tag(
32+
$value->getContent()->getVersionInfo()->getContentInfo()
33+
);
3434
}
3535
}

tests/lib/ResponseTagger/Delegator/DispatcherTaggerTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,24 @@ public function tag(mixed $value): void
110110
};
111111

112112
$dispatcher = new DispatcherTagger([$contentInfoTagger, $customTagger]);
113-
$dispatcher->tag($foo);
113+
114+
$deprecation = null;
115+
set_error_handler(static function (int $errorCode, string $errorString) use (&$deprecation): bool {
116+
if ($errorCode === E_USER_DEPRECATED) {
117+
$deprecation = $errorString;
118+
}
119+
120+
return true;
121+
});
122+
123+
try {
124+
$dispatcher->tag($foo);
125+
} finally {
126+
restore_error_handler();
127+
}
114128

115129
self::assertTrue($wasCalled, 'Custom ResponseTagger::tag() was not called by the dispatcher.');
130+
self::assertStringContainsString('does not implement supports()', $deprecation);
116131
}
117132

118133
public function testToStringWithNoTaggers(): void

0 commit comments

Comments
 (0)