$response =
json_decode((string) $this->browser->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
$errors =
$response['errors'
][0
];
static::
assertSame(403,
$this->browser->
getResponse()->
getStatusCode());
static::
assertEquals('CHECKOUT__CUSTOMER_NOT_LOGGED_IN',
$errors['code'
]);
static::
assertEquals('Forbidden',
$errors['title'
]);
static::
assertEquals('Customer is not logged in.',
$errors['detail'
]);
} public function testAddProductShouldThrowDuplicateWishlistProductException(): void
{ $productData =
$this->
createProduct($this->context
);
$this->
createCustomerWishlist($this->context,
$this->customerId,
$productData[0
]);
$this->browser
->
request( 'POST',
'/store-api/customer/wishlist/add/' .
$productData[0
] );
$response =
json_decode((string) $this->browser->
getResponse()->
getContent(), true, 512, \JSON_THROW_ON_ERROR
);
$errors =
$response['errors'
][0
];
unset($errors['meta'
]);