| @@ 53-74 (lines=22) @@ | ||
| 50 | * |
|
| 51 | * @return void |
|
| 52 | */ |
|
| 53 | public function testApply($fieldValue) |
|
| 54 | { |
|
| 55 | $cookie = new Cookie( |
|
| 56 | $this->propertyKey, |
|
| 57 | $fieldValue, |
|
| 58 | time() + 3600 * 24 * 7, |
|
| 59 | '/', |
|
| 60 | null, |
|
| 61 | false, |
|
| 62 | false |
|
| 63 | ); |
|
| 64 | $this->client->getCookieJar()->set($cookie); |
|
| 65 | $this->client->request( |
|
| 66 | 'GET', //method |
|
| 67 | '/', //uri |
|
| 68 | array(), //parameters |
|
| 69 | array(), //files |
|
| 70 | array() //server |
|
| 71 | ); |
|
| 72 | ||
| 73 | $this->assertSame($fieldValue, $this->strategy->apply($this->client->getRequest())); |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @return array<string> |
|
| @@ 104-125 (lines=22) @@ | ||
| 101 | * |
|
| 102 | * @return void |
|
| 103 | */ |
|
| 104 | public function testApplyExtract($fieldValue) |
|
| 105 | { |
|
| 106 | $cookie = new Cookie( |
|
| 107 | $this->propertyKey, |
|
| 108 | $fieldValue, |
|
| 109 | time() + 3600 * 24 * 7, |
|
| 110 | '/', |
|
| 111 | null, |
|
| 112 | false, |
|
| 113 | false |
|
| 114 | ); |
|
| 115 | $this->client->getCookieJar()->set($cookie); |
|
| 116 | $this->client->request( |
|
| 117 | 'GET', //method |
|
| 118 | '/', //uri |
|
| 119 | array(), //parameters |
|
| 120 | array(), //files |
|
| 121 | array() //server |
|
| 122 | ); |
|
| 123 | ||
| 124 | $this->assertSame('testUser', $this->strategy->apply($this->client->getRequest())); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * @return array<string> |
|