mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 22:35:01 +00:00
Change non-static class-level variables and methods to static in tests's data providers
The update modifies several test classes within the "chill-project" to change non-static class-level variables and methods to static ones. This change has been made to improve readability, performance, and to eliminate unnecessary instantiation of class objects in test scenarios. Also, flush and clear actions on the entity manager are moved to individual data providers.
This commit is contained in:
@@ -45,17 +45,17 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
self::bootKernel();
|
||||
}
|
||||
|
||||
public function dataProvider_getReachableCenters()
|
||||
public static function dataProvider_getReachableCenters()
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
$centerA = $this->prepareCenter(1, 'center A');
|
||||
$centerB = $this->prepareCenter(2, 'center B');
|
||||
$scopeA = $this->prepareScope(1, 'scope default');
|
||||
$scopeB = $this->prepareScope(2, 'scope B');
|
||||
$scopeC = $this->prepareScope(3, 'scope C');
|
||||
$centerA = self::prepareCenter(1, 'center A');
|
||||
$centerB = self::prepareCenter(2, 'center B');
|
||||
$scopeA = self::prepareScope(1, 'scope default');
|
||||
$scopeB = self::prepareScope(2, 'scope B');
|
||||
$scopeC = self::prepareScope(3, 'scope C');
|
||||
|
||||
$userA = $this->prepareUser([
|
||||
$userA = self::prepareUser([
|
||||
[
|
||||
'center' => $centerA,
|
||||
'permissionsGroup' => [
|
||||
@@ -72,7 +72,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
],
|
||||
]);
|
||||
|
||||
$ah = $this->getAuthorizationHelper();
|
||||
$ah = self::getAuthorizationHelper();
|
||||
|
||||
return [
|
||||
// without scopes
|
||||
@@ -143,15 +143,15 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
];
|
||||
}
|
||||
|
||||
public function dataProvider_getReachableScopes()
|
||||
public static function dataProvider_getReachableScopes()
|
||||
{
|
||||
$centerA = $this->prepareCenter(1, 'center A');
|
||||
$centerB = $this->prepareCenter(2, 'center B');
|
||||
$scopeA = $this->prepareScope(1, 'scope default');
|
||||
$scopeB = $this->prepareScope(2, 'scope B');
|
||||
$scopeC = $this->prepareScope(3, 'scope C');
|
||||
$centerA = self::prepareCenter(1, 'center A');
|
||||
$centerB = self::prepareCenter(2, 'center B');
|
||||
$scopeA = self::prepareScope(1, 'scope default');
|
||||
$scopeB = self::prepareScope(2, 'scope B');
|
||||
$scopeC = self::prepareScope(3, 'scope C');
|
||||
|
||||
$userA = $this->prepareUser([
|
||||
$userA = self::prepareUser([
|
||||
[
|
||||
'center' => $centerA,
|
||||
'permissionsGroup' => [
|
||||
@@ -579,7 +579,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
||||
/**
|
||||
* @return AuthorizationHelper
|
||||
*/
|
||||
private function getAuthorizationHelper()
|
||||
private static function getAuthorizationHelper()
|
||||
{
|
||||
return self::getContainer()
|
||||
->get(AuthorizationHelper::class);
|
||||
|
Reference in New Issue
Block a user