Add test for middleware arrays