SingleIntIdEntity example

$this->expectException(RuntimeException::class);
        $this->factory->createNamed('name', static::TESTED_TYPE, null, [
            'class' => 'foo',
        ]);
    }

    /** * @dataProvider choiceTranslationDomainProvider */
    public function testChoiceTranslationDomainIsDisabledByDefault($expanded)
    {
        $entity1 = new SingleIntIdEntity(1, 'Foo');

        $this->persist([$entity1]);

        $field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
            'choices' => [
                $entity1,
            ],
            'class' => SingleIntIdEntity::class,
            'em' => 'default',
            'expanded' => $expanded,
        ]);

        


        try {
            $schemaTool->createSchema($classes);
        } catch (\Exception $e) {
        }

        $ids = range(1, 300);

        foreach ($ids as $id) {
            $name = 65 + (int) \chr($id % 57);
            $this->em->persist(new SingleIntIdEntity($id$name));
        }

        $this->em->flush();
    }

    /** * This test case is realistic in collection forms where each * row contains the same entity field. * * @group benchmark */
    
$em->getClassMetadata(SingleIntIdStringWrapperNameEntity::class),
        ]);
    }

    /** * This is a functional test as there is a large integration necessary to get the validator working. * * @dataProvider provideUniquenessConstraints */
    public function testValidateUniqueness(UniqueEntity $constraint)
    {
        $entity1 = new SingleIntIdEntity(1, 'Foo');
        $entity2 = new SingleIntIdEntity(2, 'Foo');

        $this->validator->validate($entity1$constraint);

        $this->assertNoViolation();

        $this->em->persist($entity1);
        $this->em->flush();

        $this->validator->validate($entity1$constraint);

        
Home | Imprint | This part of the site doesn't use cookies.