mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-11 15:33:43 +00:00
Remove the label if there is only one scope and no scope picking field is displayed.
This commit is contained in:
@@ -11,11 +11,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Form\Type;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Form\Type\ScopePickerType;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
|
||||
@@ -39,11 +39,11 @@ final class ScopePickerTypeTest extends TypeTestCase
|
||||
{
|
||||
use ProphecyTrait;
|
||||
|
||||
public function estBuildOneScopeIsSuccessful()
|
||||
public function testBuildOneScopeIsSuccessful()
|
||||
{
|
||||
$form = $this->factory->create(ScopePickerType::class, null, [
|
||||
'center' => new Center(),
|
||||
'role' => 'ONE_SCOPE',
|
||||
'center' => [],
|
||||
]);
|
||||
|
||||
$view = $form->createView();
|
||||
@@ -54,8 +54,8 @@ final class ScopePickerTypeTest extends TypeTestCase
|
||||
public function testBuildThreeScopesIsSuccessful()
|
||||
{
|
||||
$form = $this->factory->create(ScopePickerType::class, null, [
|
||||
'center' => new Center(),
|
||||
'role' => 'THREE_SCOPE',
|
||||
'center' => [],
|
||||
]);
|
||||
|
||||
$view = $form->createView();
|
||||
@@ -66,8 +66,8 @@ final class ScopePickerTypeTest extends TypeTestCase
|
||||
public function testBuildTwoScopesIsSuccessful()
|
||||
{
|
||||
$form = $this->factory->create(ScopePickerType::class, null, [
|
||||
'center' => new Center(),
|
||||
'role' => 'TWO_SCOPE',
|
||||
'center' => [],
|
||||
]);
|
||||
|
||||
$view = $form->createView();
|
||||
@@ -101,10 +101,13 @@ final class ScopePickerTypeTest extends TypeTestCase
|
||||
static fn ($args) => $args[0]['fr']
|
||||
);
|
||||
|
||||
$centerResolverManager = $this->prophesize(CenterResolverManagerInterface::class);
|
||||
|
||||
$type = new ScopePickerType(
|
||||
$translatableStringHelper->reveal(),
|
||||
$authorizationHelper->reveal(),
|
||||
$security->reveal(),
|
||||
$translatableStringHelper->reveal()
|
||||
$centerResolverManager->reveal()
|
||||
);
|
||||
|
||||
// add the mocks for creating EntityType
|
||||
|
||||
Reference in New Issue
Block a user