Dumplie\Metadata\Tests\Integration\Generic\MetadataTestCase::test_updating_metadata PHP Method

test_updating_metadata() public method

    public function test_updating_metadata()
    {
        $mao = $this->registry->getMAO("product");
        $id = MetadataId::generate();
        $mao->save(new Metadata($id, "product", ["sku" => "DUMPLIE_SKU_1", "name" => "Super Product"]));
        $metadata = $mao->findBy(["sku" => "DUMPLIE_SKU_1"]);
        $metadata->name = "Super Product Deluxe";
        $mao->save($metadata);
        $metadata = $mao->findBy(["sku" => "DUMPLIE_SKU_1"]);
        $this->assertEquals("Super Product Deluxe", $metadata->name);
    }