Exemple #1
0
 /**
  * Runs the test.
  */
 public function test()
 {
     $name = 'Organization';
     $value = 'Jyxo';
     // Email and name given
     $header = new Header($name, $value);
     $this->assertEquals($name, $header->getName());
     $this->assertEquals($value, $header->getValue());
 }
Exemple #2
0
 public function setHeader(Header $h)
 {
     // replace content if header already exists
     $replaced = false;
     for ($i = 0; $i < count($this->headers) && !$replaced; $i++) {
         if ($this->headers[$i]->getKey() == $h->getKey()) {
             $this->headers[$i]->setValue($h->getValue());
             $replaced = true;
         }
     }
     // no matches found, add new header
     if (!$replaced) {
         $this->headers[] = $h;
     }
 }
Exemple #3
0
 /**
  * @todo Implement testGetValue().
  */
 public function testGetValue()
 {
     $this->assertEquals($this->readAttribute($this->object, 'value'), $this->object->getValue());
 }