Why is my functional test not matching my manual testing?
The assertion failure looks as though the testing framework isn't following the double redirect (from /user/logout to &lt;front&gt; and thence to /node/2). Maybe explicitly request the front page after logging out?

Ie. 

$this-&gt;drupalGet('user/logout');
$this-&gt;drupalGet('&lt;front&gt;');
$this-&gt;assertUrl('node/2');