mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 00:24:59 +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:
@@ -28,7 +28,7 @@ trait PrepareCenterTrait
|
||||
/**
|
||||
* prepare a mocked center, with and id and name given.
|
||||
*/
|
||||
protected function prepareCenter(int $id, string $name): Center
|
||||
protected static function prepareCenter(int $id, string $name): Center
|
||||
{
|
||||
$center = new Center();
|
||||
$center->setName($name);
|
||||
|
@@ -28,7 +28,7 @@ trait PrepareScopeTrait
|
||||
*
|
||||
* The name will be present in both lang `fr` and `en`.
|
||||
*/
|
||||
protected function prepareScope(int $id, string $name): Scope
|
||||
protected static function prepareScope(int $id, string $name): Scope
|
||||
{
|
||||
$scope = new Scope();
|
||||
// set the name
|
||||
|
@@ -50,7 +50,7 @@ trait PrepareUserTrait
|
||||
*
|
||||
* @throws \LogicException if the trait is not set up
|
||||
*/
|
||||
protected function prepareUser(array $permissions)
|
||||
protected static function prepareUser(array $permissions)
|
||||
{
|
||||
$user = new User();
|
||||
|
||||
|
Reference in New Issue
Block a user