Exemple #1
0
 /**
  * Test the conversion of the header to an array
  */
 public function testToArray()
 {
     $key = 'somekey';
     $algorithm = 'H256';
     $type = 'mytype';
     $header = new Header($key, $algorithm, $type);
     $this->assertEquals($header->toArray(), array('typ' => $type, 'alg' => $algorithm));
 }
Exemple #2
0
 public function testBuildEntityArrayWithValueOnly()
 {
     $headerStr = '10.0.0.1,10.0.0.2,10.0.0.3';
     $header = new \Header('X-Forwarded-For', $headerStr, ',');
     $header->parseParams();
     $this->assertEquals(3, $header->count());
     $partsArray = $header->toArray();
     $this->assertEquals('10.0.0.1', $partsArray[0]);
     $entityArray = $header->buildEntityArray();
     $this->assertEquals(3, count($entityArray[0]));
 }