Goodness-of-fit test
Suppose $(N_1, \ldots, N_k) \sim \mathrm{Multinomial}(n; p_1, \ldots, p_k)$. Test $H_0: p=p_0(θ)$ for some $θ$ against $H_1: p_i$ unrestricted (but still $p_i\geq 0$ and $\sum_{i} p_i=1$), excluding $H_0$.
Apply Pearson's chi-squared test with $$ \begin{align*} O_i = N_i, \qquad E_i = np_{0i}(\hat θ_{\text{MLE}}), \qquad d = k-1-\op{df}(H_0). \end{align*} $$ where $\hat θ_{\text{MLE}}$ is the maximum likelihood estimator for $θ$ under $H_0$ and $\op{df}(H_0)$ is the degree of freedom of $H_0$. (Derivation)