Unconquerable planet?

Unconquerable planet?

I've never come remotely close to this of course but was wondering what would happen if you were invaded after surrounding the capital of a planet with six indestructible buildings and stuck a legion in it.

I'm guessing that this would cause an infinite loop, maybe after all other buildings had been destroyed. Or do attackers go through indestructible buildings without affecting them?