Fixed language manager unit test. Issue #3957
Removed phtml file extension.
Fixed logic errors and poorly written loop
Improved conciseness and quality of code
Merge pull request #4106 from DaBungalow/fix-language-test

Fixed language manager unit test. Issue #3957