addHeader('Referer: http://www.Example.com');//fake the HTTP_REFERER to look like a click from a 3rd party site $this->get('http://www.MyWebSite.com'); //get the page $this->assertResponse(200); //its OK $this->assertText('I hope you had fun at Example.com, but you will have even more fun here, so stick with us'); } function testPageReactsToInternalReferees() { $this->addHeader('Referer: http://www.MyWebSite.com');//fake the HTTP_REFERER to look like a click from your own site $this->get('http://www.MyWebSite.com'); //get the page $this->assertResponse(200); //its OK $this->assertText('Hello Again - Glad you stuck around'); } } /** relates to : http://www.eatmybusiness.com/food/2010/04/08/setting-the-referrer-in-simpletest-web-tests-faking-the-http_referer/150/ */