Source

						public function testToContextWithAuth() {
		$request = new Request(array(
			'auth' => 'Basic',
			'username' => 'Aladdin',
			'password' => 'open sesame'
		));
		$expected = array('http' => array(
			'method' => 'GET',
			'header' => array(
				'Host: localhost',
				'Connection: Close',
				'User-Agent: Mozilla/5.0',
				'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
			),
			'content' => '',
			'protocol_version' => '1.1',
			'ignore_errors' => true,
			'follow_location' => true
		));
		$this->assertEqual($expected, $request->to('context'));
	}