File tree Expand file tree Collapse file tree
src/lib/ResponseTagger/Delegator
tests/lib/ResponseTagger/Delegator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ index 9982c21..03ac40a 100644
1919+++ b/public/index.php
2020@@ -1,9 +1,14 @@
2121 <?php
22-
22+
2323 use App\Kernel;
2424+use Ibexa\Bundle\HttpCache\AppCache;
2525+use Symfony\Component\HttpFoundation\Request;
26-
26+
2727 require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
28-
28+
2929 return function (array $context) {
3030- return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
3131+ $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments