Source

						public function testContentNegotiationByUserAgent() {
		Media::type('iphone', 'application/xhtml+xml', array(
			'conditions' => array('mobile' => true)
		));
		$request = new Request(array('env' => array(
			'HTTP_USER_AGENT' => 'Safari',
			'HTTP_ACCEPT' => 'application/xhtml+xml,text/html'
		)));
		$this->assertEqual('html', Media::negotiate($request));

		$request = new Request(array('env' => array(
			'HTTP_USER_AGENT' => 'iPhone',
			'HTTP_ACCEPT' => 'application/xhtml+xml,text/html'
		)));
		$this->assertEqual('iphone', Media::negotiate($request));
	}