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

test_updating_metadata() public method

    public function test_updating_metadata()
    {
        $mao = $this->registry->getMAO("test");
        $id = MetadataId::generate();
        $mao->save(new Metadata($id, "test", []));
        $metadata = $mao->getBy(['id' => (string) $id]);
        $metadata->without_default = 0;
        $metadata->with_integer = 123;
        $metadata->with_float = 123.456;
        $mao->save($metadata);
        $metadata = $mao->getBy(['id' => (string) $id]);
        $this->assertSame(0.0, $metadata->without_default);
        $this->assertSame(123.0, $metadata->with_integer);
        $this->assertSame(123.456, $metadata->with_float);
    }