public function __construct() { $this->enum = Enum::ALPHA(); }
/** * @dataProvider entityManagerDataProvider * @param EntityManager $em */ public function testSerialisation(EntityManager $em) { $product = new Product(); $product->setId(700)->setEnum(Enum::BRAVO())->setList(['a', 'b', 'c']); $em->persist($product)->flush(); /** @var Product $r_product */ $r_product = $em->retrieve(Product::class, '700'); $this->assertEquals(Enum::BRAVO(), $r_product->getEnum()); $this->assertCount(3, $r_product->getList()); $this->assertEquals('a', $r_product->getList()[0]); $this->assertEquals('c', $r_product->getList()[2]); }