File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 9
9
use Codeception \Lib \Interfaces \PartedModule ;
10
10
use Symfony \Component \Finder \Finder ;
11
11
use Symfony \Component \DependencyInjection \ContainerInterface ;
12
+ use Symfony \Component \VarDumper \Cloner \Data ;
12
13
13
14
/**
14
15
* This module uses Symfony Crawler and HttpKernel to emulate requests and test response.
@@ -474,10 +475,16 @@ protected function debugResponse($url)
474
475
if ($ profile = $ this ->getProfile ()) {
475
476
if ($ profile ->hasCollector ('security ' )) {
476
477
if ($ profile ->getCollector ('security ' )->isAuthenticated ()) {
478
+ $ roles = $ profile ->getCollector ('security ' )->getRoles ();
479
+
480
+ if ($ roles instanceof Data) {
481
+ $ roles = $ this ->extractRawRoles ($ roles );
482
+ }
483
+
477
484
$ this ->debugSection (
478
485
'User ' ,
479
486
$ profile ->getCollector ('security ' )->getUser ()
480
- . ' [ ' . implode (', ' , $ profile -> getCollector ( ' security ' )-> getRoles () ) . '] '
487
+ . ' [ ' . implode (', ' , $ roles ) . '] '
481
488
);
482
489
} else {
483
490
$ this ->debugSection ('User ' , 'Anonymous ' );
@@ -495,6 +502,17 @@ protected function debugResponse($url)
495
502
}
496
503
}
497
504
505
+ /**
506
+ * @param Data $data
507
+ * @return array
508
+ */
509
+ private function extractRawRoles (Data $ data )
510
+ {
511
+ $ raw = $ data ->getRawData ();
512
+
513
+ return isset ($ raw [1 ]) ? $ raw [1 ] : [];
514
+ }
515
+
498
516
/**
499
517
* Returns a list of recognized domain names.
500
518
*
You can’t perform that action at this time.
0 commit comments