The Test of Life was part of a trial within Klingon culture.
In the 2260's after the Klingon Empire destroyed their colony of Hrakkour due to the peaceful message spread by Quetzalcoatl, they took the entity for trial. Captain James T. Kirk, however, demanded that it be an honorable one and volunteered to act on the depowered entity's behalf. Thus, Admiral Vlict Kenka had them transported to begin the Test of Life. They placed in a chamber where they had to defeat an energy being and escape the confines of the room. (TOS video game: 25th Anniversary)