diff options
author | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-17 17:27:27 +0200 |
---|---|---|
committer | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-17 17:27:27 +0200 |
commit | f9b8008a4ccae56009894e4052dba80752d562bc (patch) | |
tree | 453331a525fc3e09c30ca3e52d85959306fe41bc /_testing/core/TestResponse.php | |
parent | e048653b52aad13b5964e1626192ffee2211870b (diff) | |
download | rpg-f9b8008a4ccae56009894e4052dba80752d562bc.tar.gz rpg-f9b8008a4ccae56009894e4052dba80752d562bc.tar.bz2 |
BROKEN added enable/disable feature for plugins
Diffstat (limited to '_testing/core/TestResponse.php')
-rw-r--r-- | _testing/core/TestResponse.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/_testing/core/TestResponse.php b/_testing/core/TestResponse.php new file mode 100644 index 000000000..ed112b42e --- /dev/null +++ b/_testing/core/TestResponse.php @@ -0,0 +1,38 @@ +<?php +/** + * holds a copy of all produced outputs of a TestRequest + */ +class TestResponse { + protected $content; + protected $headers; + + /** + * @var phpQueryObject + */ + protected $pq = null; + + function __construct($content, $headers) { + $this->content = $content; + $this->headers = $headers; + } + + function getContent() { + return $this->content; + } + + function getHeaders() { + return $this->headers; + } + + /** + * Query the response for a JQuery compatible CSS selector + * + * @link https://code.google.com/p/phpquery/wiki/Selectors + * @param string selector + * @returns object a PHPQuery object + */ + function queryHTML($selector){ + if(is_null($this->pq)) $this->pq = phpQuery::newDocument($this->content); + return $this->pq->find($selector); + } +} |