post(self::ENDPOINT_PATH, ['json' => ['name' => 'Testing workflow', 'steps' => []]]); $this->assertSame([ 'code' => 'rest_forbidden', 'message' => 'Sorry, you are not allowed to do that.', 'data' => ['status' => 401], ], $data); } public function testCreateWorkflow(): void { $data = $this->post(self::ENDPOINT_PATH, [ 'json' => [ 'name' => 'Testing workflow', 'steps' => [ 'e6d193766b9ecd1e' => [ 'id' => 'e6d193766b9ecd1e', 'type' => 'action', 'key' => 'core:wait', 'args' => ['seconds' => 60], ], '0d618edf689909ef' => [ 'id' => '0d618edf689909ef', 'type' => 'trigger', 'key' => 'mailpoet:segment:subscribed', 'next_step_id' => 'e6d193766b9ecd1e', ], ], ], ]); $this->assertSame(['data' => null], $data); } }