/**
  * @return array
  */
 protected function getBusinessUnitIds()
 {
     /** @var OwnerTree $tree */
     $tree = $this->treeProvider->getTree();
     $user = $this->getUser();
     $result = [];
     $organizations = $user->getOrganizations();
     foreach ($organizations as $organization) {
         $subBUIds = $tree->getUserSubordinateBusinessUnitIds($user->getId(), $organization->getId());
         $result = array_merge($result, $subBUIds);
     }
     return array_unique($result);
 }
 /**
  * @expectedException \Oro\Bundle\SecurityBundle\Exception\UnsupportedOwnerTreeProviderException
  * @expectedExceptionMessage Supported provider not found in chain
  */
 public function testGetTreeFailed()
 {
     $this->provider->getTree();
 }