/** * @test * @depends automaticHeadersAreSetOnEachRequest */ public function automaticHeadersCanBeRemovedAgain() { $requestEngine = $this->createMock(Client\RequestEngineInterface::class); $requestEngine->expects($this->once())->method('sendRequest')->will($this->returnValue(new Http\Response())); $this->browser->setRequestEngine($requestEngine); $this->browser->addAutomaticRequestHeader('X-Test-Header', 'Acme'); $this->browser->removeAutomaticRequestHeader('X-Test-Header'); $this->browser->request('http://localhost/foo'); $this->assertFalse($this->browser->getLastRequest()->hasHeader('X-Test-Header')); }