protected function testUrl($url, $expectedStatusCode = 200) { $nbRedirects = 0; $this->startCounter($url); dm::resetStartTime(); $this->browser->get($url); while (in_array($this->browser->getResponse()->getStatusCode(), array(301, 302))) { $this->browser->with('response')->begin()->isRedirected()->end()->followRedirect(); $nbRedirects++; if ($nbRedirects > $this->options['maxRedirections']) { $this->browser->info('Too many redirections'); break; } } $this->stopCounter(); $this->browser->with('response')->begin()->isStatusCode($expectedStatusCode)->end(); if ($this->options['validate']) { $this->browser->with('response')->begin()->isValid()->end(); } }