Added test for environment self-referencing relationship