Changeset 1105
- Timestamp:
- 12/04/07 11:29:10 (7 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/ipo/request/stubAbstractRequest.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ipo/request/stubRequest.php (modified) (1 diff)
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestPrefixDecorator.php (modified) (1 diff)
- trunk/src/test/php/net/stubbles/ipo/request/stubAbstractRequestTestCase.php (modified) (4 diffs)
- trunk/src/test/php/net/stubbles/ipo/request/stubRequestPrefixDecoratorTestCase.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ipo/request/stubAbstractRequest.php
r1034 r1105 86 86 87 87 /** 88 * checks if requestor accepts cookies 89 * 90 * Warning! Detection is based on the amount of cookie values returned by 91 * the user agent. If the user agent did not send any cookies this does not 92 * necessarily mean that the user agent will not accept cookies. 93 * 94 * @return bool 95 */ 96 public function acceptsCookies() 97 { 98 return (count($this->unsecureCookies) > 0); 99 } 100 101 /** 88 102 * checks whether a request value is set or not 89 103 * trunk/src/main/php/net/stubbles/ipo/request/stubRequest.php
r1036 r1105 43 43 44 44 /** 45 * checks if requestor accepts cookies 46 * 47 * @return bool 48 */ 49 public function acceptsCookies(); 50 51 /** 45 52 * checks whether a request value is set or not 46 53 * trunk/src/main/php/net/stubbles/ipo/request/stubRequestPrefixDecorator.php
r1036 r1105 70 70 71 71 /** 72 * checks if requestor accepts cookies 73 * 74 * @return bool 75 */ 76 public function acceptsCookies() 77 { 78 return $this->request->acceptsCookies(); 79 } 80 81 /** 72 82 * checks whether a request value is set or not 73 83 * trunk/src/test/php/net/stubbles/ipo/request/stubAbstractRequestTestCase.php
r1040 r1105 1 1 <?php 2 2 /** 3 * Tests for net .stubbles.ipo.request.stubAbstractRequest3 * Tests for net::stubbles::ipo::request::stubAbstractRequest. 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> … … 31 31 } 32 32 33 public function removeCookieValues() 34 { 35 $this->unsecureCookies = array(); 36 } 37 33 38 public function getMethod() 34 39 { … … 52 57 } 53 58 /** 54 * Tests for net .stubbles.ipo.request.stubAbstractRequest59 * Tests for net::stubbles::ipo::request::stubAbstractRequest. 55 60 * 56 61 * @package stubbles … … 72 77 { 73 78 $this->request = new stubTestRequest(); 79 } 80 81 /** 82 * test whether cookies are accepted or not 83 * 84 */ 85 public function testAcceptsCookies() 86 { 87 $this->assertTrue($this->request->acceptsCookies()); 88 $this->request->removeCookieValues(); 89 $this->assertFalse($this->request->acceptsCookies()); 74 90 } 75 91 trunk/src/test/php/net/stubbles/ipo/request/stubRequestPrefixDecoratorTestCase.php
r1036 r1105 1 1 <?php 2 2 /** 3 * Tests for ipo.request.stubRequestPrefixDecorator3 * Tests for net::stubbles::ipo::request::stubRequestPrefixDecorator. 4 4 * 5 5 * @author Frank Kleine <mikey@stubbles.net> 6 6 * @package stubbles 7 * @subpackage ipo_ test7 * @subpackage ipo_request_test 8 8 */ 9 9 stubClassLoader::load('net.stubbles.ipo.request.stubRequestPrefixDecorator'); … … 12 12 Mock::generate('stubFilter'); 13 13 /** 14 * Tests for ipo.request.stubRequestPrefixDecorator14 * Tests for net::stubbles::ipo::request::stubRequestPrefixDecorator. 15 15 * 16 16 * @package stubbles 17 * @subpackage ipo_ test17 * @subpackage ipo_request_test 18 18 */ 19 19 class stubRequestPrefixDecoratorTestCase extends UnitTestCase … … 39 39 $this->mockRequest = new MockStubRequest(); 40 40 $this->request = new stubRequestPrefixDecorator($this->mockRequest, 'test'); 41 } 42 43 /** 44 * test that acceptCookies() returns correct answer 45 */ 46 public function testAcceptsCookies() 47 { 48 $this->mockRequest->setReturnValueAt(0, 'acceptsCookies', true); 49 $this->mockRequest->setReturnValueAt(1, 'acceptsCookies', false); 50 $this->assertTrue($this->request->acceptsCookies()); 51 $this->assertFalse($this->request->acceptsCookies()); 41 52 } 42 53
