Permalink
Browse files

[BrowserKit] tagged the guaranteed BC API

  • Loading branch information...
1 parent 4953471 commit 9839e645c9df92183238432f24989b844487947a @fabpot fabpot committed Mar 24, 2011
Showing with 101 additions and 4 deletions.
  1. +37 −1 Client.php
  2. +24 −0 Cookie.php
  3. +11 −1 CookieJar.php
  4. +18 −0 Request.php
  5. +11 −2 Response.php
View
@@ -28,6 +28,8 @@
* you need to also implement the getScript() method.
*
* @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
*/
abstract class Client
{
@@ -47,6 +49,8 @@
* @param array $server The server parameters (equivalent of $_SERVER)
* @param History $history A History instance to store the browser history
* @param CookieJar $cookieJar A CookieJar instance to store the cookies
+ *
+ * @api
*/
public function __construct(array $server = array(), History $history = null, CookieJar $cookieJar = null)
{
@@ -61,6 +65,8 @@ public function __construct(array $server = array(), History $history = null, Co
* Sets whether to automatically follow redirects or not.
*
* @param Boolean $followRedirect Whether to follow redirects
+ *
+ * @api
*/
public function followRedirects($followRedirect = true)
{
@@ -73,6 +79,8 @@ public function followRedirects($followRedirect = true)
* @param Boolean $insulated Whether to insulate the requests or not
*
* @throws \RuntimeException When Symfony Process Component is not installed
+ *
+ * @api
*/
public function insulate($insulated = true)
{
@@ -89,6 +97,8 @@ public function insulate($insulated = true)
* Sets server parameters.
*
* @param array $server An array of server parameters
+ *
+ * @api
*/
public function setServerParameters(array $server)
{
@@ -102,6 +112,8 @@ public function setServerParameters(array $server)
* Returns the History instance.
*
* @return History A History instance
+ *
+ * @api
*/
public function getHistory()
{
@@ -112,6 +124,8 @@ public function getHistory()
* Returns the CookieJar instance.
*
* @return CookieJar A CookieJar instance
+ *
+ * @api
*/
public function getCookieJar()
{
@@ -122,6 +136,8 @@ public function getCookieJar()
* Returns the current Crawler instance.
*
* @return Crawler A Crawler instance
+ *
+ * @api
*/
public function getCrawler()
{
@@ -132,6 +148,8 @@ public function getCrawler()
* Returns the current Response instance.
*
* @return Response A Response instance
+ *
+ * @api
*/
public function getResponse()
{
@@ -142,6 +160,8 @@ public function getResponse()
* Returns the current Request instance.
*
* @return Request A Request instance
+ *
+ * @api
*/
public function getRequest()
{
@@ -152,6 +172,8 @@ public function getRequest()
* Clicks on a given link.
*
* @param Link $link A Link instance
+ *
+ * @api
*/
public function click(Link $link)
{
@@ -163,6 +185,8 @@ public function click(Link $link)
*
* @param Form $form A Form instance
* @param array $values An array of form field values
+ *
+ * @api
*/
public function submit(Form $form, array $values = array())
{
@@ -183,6 +207,8 @@ public function submit(Form $form, array $values = array())
* @param Boolean $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
*
* @return Crawler
+ *
+ * @api
*/
public function request($method, $uri, array $parameters = array(), array $files = array(), array $server = array(), $content = null, $changeHistory = true)
{
@@ -195,7 +221,7 @@ public function request($method, $uri, array $parameters = array(), array $files
$server['HTTP_HOST'] = parse_url($uri, PHP_URL_HOST);
$server['HTTPS'] = 'https' == parse_url($uri, PHP_URL_SCHEME);
- $request = new Request($uri, $method, $parameters, $files, $this->cookieJar->getValues($uri), $server, $content);
+ $request = new Request($uri, $method, $parameters, $files, $this->cookieJar->allValues($uri), $server, $content);
$this->request = $this->filterRequest($request);
@@ -311,6 +337,8 @@ protected function createCrawlerFromContent($uri, $content, $type)
* Goes back in the browser history.
*
* @return Crawler
+ *
+ * @api
*/
public function back()
{
@@ -321,6 +349,8 @@ public function back()
* Goes forward in the browser history.
*
* @return Crawler
+ *
+ * @api
*/
public function forward()
{
@@ -331,6 +361,8 @@ public function forward()
* Reloads the current browser.
*
* @return Crawler
+ *
+ * @api
*/
public function reload()
{
@@ -343,6 +375,8 @@ public function reload()
* @return Crawler
*
* @throws \LogicException If request was not a redirect
+ *
+ * @api
*/
public function followRedirect()
{
@@ -357,6 +391,8 @@ public function followRedirect()
* Restarts the client.
*
* It flushes all cookies.
+ *
+ * @api
*/
public function restart()
{
View
@@ -15,6 +15,8 @@
* Cookie represents an HTTP cookie.
*
* @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
*/
class Cookie
{
@@ -38,6 +40,8 @@ class Cookie
* @param string $domain The domain that the cookie is available
* @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
* @param bool $httponly The cookie httponly flag
+ *
+ * @api
*/
public function __construct($name, $value, $expires = null, $path = '/', $domain = '', $secure = false, $httponly = false)
{
@@ -54,6 +58,8 @@ public function __construct($name, $value, $expires = null, $path = '/', $domain
* Returns the HTTP representation of the Cookie.
*
* @return string The HTTP representation of the Cookie
+ *
+ * @api
*/
public function __toString()
{
@@ -89,6 +95,8 @@ public function __toString()
* @param string $url The base URL
*
* @return Cookie A Cookie instance
+ *
+ * @api
*/
static public function fromString($cookie, $url = null)
{
@@ -162,6 +170,8 @@ static public function fromString($cookie, $url = null)
* Gets the name of the cookie.
*
* @return string The cookie name
+ *
+ * @api
*/
public function getName()
{
@@ -172,6 +182,8 @@ public function getName()
* Gets the value of the cookie.
*
* @return string The cookie value
+ *
+ * @api
*/
public function getValue()
{
@@ -182,6 +194,8 @@ public function getValue()
* Gets the expires time of the cookie.
*
* @return string The cookie expires time
+ *
+ * @api
*/
public function getExpiresTime()
{
@@ -192,6 +206,8 @@ public function getExpiresTime()
* Gets the path of the cookie.
*
* @return string The cookie path
+ *
+ * @api
*/
public function getPath()
{
@@ -202,6 +218,8 @@ public function getPath()
* Gets the domain of the cookie.
*
* @return string The cookie domain
+ *
+ * @api
*/
public function getDomain()
{
@@ -212,6 +230,8 @@ public function getDomain()
* Returns the secure flag of the cookie.
*
* @return Boolean The cookie secure flag
+ *
+ * @api
*/
public function isSecure()
{
@@ -222,6 +242,8 @@ public function isSecure()
* Returns the httponly flag of the cookie.
*
* @return Boolean The cookie httponly flag
+ *
+ * @api
*/
public function isHttpOnly()
{
@@ -232,6 +254,8 @@ public function isHttpOnly()
* Returns true if the cookie has expired.
*
* @return Boolean true if the cookie has expired, false otherwise
+ *
+ * @api
*/
public function isExpired()
{
View
@@ -15,6 +15,8 @@
* CookieJar.
*
* @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @api
*/
class CookieJar
{
@@ -24,6 +26,8 @@ class CookieJar
* Sets a cookie.
*
* @param Cookie $cookie A Cookie instance
+ *
+ * @api
*/
public function set(Cookie $cookie)
{
@@ -36,6 +40,8 @@ public function set(Cookie $cookie)
* @param string $name The cookie name
*
* @return Cookie|null A Cookie instance or null if the cookie does not exist
+ *
+ * @api
*/
public function get($name)
{
@@ -48,6 +54,8 @@ public function get($name)
* Removes a cookie by name.
*
* @param string $name The cookie name
+ *
+ * @api
*/
public function expire($name)
{
@@ -56,6 +64,8 @@ public function expire($name)
/**
* Removes all the cookies from the jar.
+ *
+ * @api
*/
public function clear()
{
@@ -94,7 +104,7 @@ public function all()
*
* @return array An array of cookie values
*/
- public function getValues($uri)
+ public function allValues($uri)
{
$this->flushExpiredCookies();
Oops, something went wrong.

0 comments on commit 9839e64

Please sign in to comment.