Dumplie\Metadata\Tests\Integration\Generic\AssociationTypeTestCase::test_removing_metadata PHP Метод

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

    public function test_removing_metadata()
    {
        $mao = $this->registry->getMAO("product");
        $productId = MetadataId::generate();
        $categoryId = MetadataId::generate();
        $mao->save(new Metadata($productId, "product", ["category" => new Metadata($categoryId, 'category', ["name" => "Fancy stuff"])]));
        $mao->delete($productId);
        $this->assertFalse($this->storage->has("association", "product", (string) $productId));
        $this->assertTrue($this->storage->has("association", "category", (string) $categoryId));
    }