Dumplie\Metadata\Tests\Integration\Generic\DateTimeTypeTestCase::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]);
        $updatedDate = new \DateTimeImmutable();
        $metadata->without_default = $updatedDate;
        $mao->save($metadata);
        $metadata = $mao->getBy(['id' => (string) $id]);
        $this->assertEquals($updatedDate->format('U'), $metadata->without_default->format('U'));
    }