Пример #1
0
 public function testAddHeader()
 {
     $testName = self::randomName();
     $testValue = self::randomString();
     $anotherName = self::randomName();
     $anotherValue = self::randomString();
     $message = new Message();
     $headers = [$testName => $testValue, $anotherName => $anotherValue];
     $message->addHeader($testName, $testValue);
     $this->assertSame($testValue, $message->getHeader($testName));
     $message->addHeader($headers);
     $this->assertSame($anotherValue, $message->getHeader($anotherName));
     $this->assertSame($headers, $message->getHeaders());
 }
Пример #2
0
 public function testAddHeader()
 {
     $testName = $this->faker->word;
     $testValue = $this->faker->word;
     $anotherName = $this->faker->word;
     $anotherValue = $this->faker->word;
     $message = new Message();
     $headers = [$testName => $testValue, $anotherName => $anotherValue];
     $message->addHeader($testName, $testValue);
     $this->assertSame($testValue, $message->getHeader($testName));
     $message->addHeader($headers);
     $this->assertSame($anotherValue, $message->getHeader($anotherName));
     $this->assertSame($headers, $message->getHeaders());
 }