We are in a setting where we $X_1,\ldots,X_n\sim N(\theta, \sigma^2)$ where we assume $\sigma^2$ to be known. We test $H_{0}:\theta\leq\theta_{0}$ versus $H_{1}:\theta>\theta_{0}$.
I am aware that this question has already been asked here but my teacher gave me a different way of obtaining the answer. However, I am not sure how exactly this method works so I'd like some additional explanation.
The answer my teacher gave: We know that our test statistic $T$ follows a standard normal distribution. Therefore, the $p$-value can be derived from:
$p=\sup_{\theta\leq\theta_{0}}\mathbb{P}_{\theta}(T>t)=\mathbb{P}_{\theta_{0}}(T>t)=1-\Phi(\sqrt{n}\frac{(\bar{X}_n - \theta_0)}{\sigma})$
Where $t$ is some realization from the test statistic.
My problem: Perhaps some notation is incorrect because it was just a quick scribble made by him. However, there must be some truth behind this way of obtaining the $p$-value. My question is, why does this work? What is necessary for this to work, other than $T$ being standard normally distributed?
Any additional information helps. Thanks in advance!