I run some Playwright tests on a CI server which initializes my database and content from scratch.
I create a Consumer programmatically, but the problem is that since no image styles are selected by default, it doesn't return anything and the tests fail.
How can I set the image styles when programmatically creating a consumer?
I create the consumer like this:
$consumer = Consumer::create([
'label' => 'JSON:API Images',
'description' => "My consumer",
'client_id' => 'my_sepcial_consumer',
// @todo This can't be set like this.
// 'image_styles_target_id' => ['fallback_phone', 'phone'],.
'is_default' => TRUE,
'third_party' => FALSE,
]
);
Fixed
4.0
Documentation