|
@@ -46,8 +46,17 @@ class ActiveVoterTest extends AbstractVoterTest
|
|
|
$item = $this->getMockForAbstractClass('Knp\Menu\ItemInterface');
|
|
|
$item->expects($this->any())
|
|
|
->method('getExtra')
|
|
|
- ->with('active')
|
|
|
- ->will($this->returnValue($data))
|
|
|
+ ->with($this->logicalOr(
|
|
|
+ $this->equalTo('active'),
|
|
|
+ $this->equalTo('sonata_admin')
|
|
|
+ ))
|
|
|
+ ->will($this->returnCallback(function ($name) use ($data) {
|
|
|
+ if ('active' === $name) {
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }))
|
|
|
;
|
|
|
|
|
|
return $item;
|