mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Fix: AuthorizationHelperTest: remove deprecated and deprecation of PrepareScopeTrait
This commit is contained in:
@@ -11,6 +11,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Test;
|
||||
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
|
||||
/**
|
||||
* A trait to prepare center.
|
||||
*
|
||||
@@ -18,25 +20,24 @@ namespace Chill\MainBundle\Test;
|
||||
* and use tearDownTrait after usage.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @deprecated use PrepareCircleTrait instead
|
||||
*/
|
||||
trait PrepareScopeTrait
|
||||
{
|
||||
use PrepareCircleTrait;
|
||||
|
||||
/**
|
||||
* prepare a mocked center, with and id and name given.
|
||||
* prepare a mocked scope, with and id and name given.
|
||||
*
|
||||
* @param int $id
|
||||
* @param string $name
|
||||
*
|
||||
* @return \Chill\MainBundle\Entity\Center
|
||||
*
|
||||
* @deprecated
|
||||
* The name will be present in both lang `fr` and `en`.
|
||||
*/
|
||||
protected function prepareScope($id, $name)
|
||||
protected function prepareScope(int $id, string $name): Scope
|
||||
{
|
||||
return $this->prepareCircle($id, $name);
|
||||
$scope = new Scope();
|
||||
// set the name
|
||||
$scope->setName(['fr' => $name, 'en' => $name]);
|
||||
$reflection = new \ReflectionClass($scope);
|
||||
$idProperty = $reflection->getProperty('id');
|
||||
$idProperty->setAccessible(true);
|
||||
$idProperty->setValue($scope, $id);
|
||||
|
||||
return $scope;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user