Bravo3\Orm\Tests\EntityManagerTest::testRefresh PHP Метод

testRefresh() публичный Метод

public testRefresh ( EntityManager $em )
$em Bravo3\Orm\Services\EntityManager
    public function testRefresh(EntityManager $em)
    {
        $product = new Product();
        $product->setId(222)->setName('Test Product')->setDescription("lorem ipsum");
        $em->persist($product)->flush();
        $r = $em->retrieve(Product::class, '222');
        $r->setDescription('hello world');
        $em->persist($r)->flush();
        $this->assertEquals('lorem ipsum', $product->getDescription());
        $this->assertFalse($product instanceof OrmProxyInterface);
        $em->refresh($product);
        $this->assertEquals('hello world', $product->getDescription());
        $this->assertTrue($product instanceof OrmProxyInterface);
    }