示例#1
0
 public function test_removing_metadata()
 {
     $mao = $this->registry->getMAO("product");
     $id = MetadataId::generate();
     $mao->save(new Metadata($id, "product", ["sku" => "DUMPLIE_SKU_1", "name" => "Super Product"]));
     $mao->delete($id);
     $this->assertFalse($this->storage->has("inventory", "product", (string) $id));
 }
 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));
 }