\documentclass[a4paper]{article}
\usepackage{multirow}
\usepackage{graphicx}
\directlua { tex.enableprimitives('',{'pagedir','bodydir','pardir','textdir','mathdir'}) }
\mathdir TRT % comment out this line to see the difference
\begin{document}
\[
\begin{tabular}{|c|c|c|c|c|}
\hline & & & & \\
\hline \multirow{2}{*}{\rotatebox{90}{\mbox{test}}} & 1 & test & $\sum$ & $\int$ \\ 
 & 1 & 2 & 3 & 4 \\ 
\hline \multirow{2}{*}{\rotatebox{45}{\mbox{test}}} &  &  &  &  \\ 
  &  &  &  &  \\ 
\hline 
\end{tabular} 
\]
\end{document}