public function testImplementsCount() { $data = new Collection(); $this->assertEquals(0, $data->count()); $data->add('key', 'value'); $this->assertEquals(1, count($data)); $data->add('key', 'value2'); $this->assertEquals(1, count($data)); $data->add('key_2', 'value3'); $this->assertEquals(2, count($data)); }
/** * @deprecated Use $message->getHeader()->parseParams() * @codeCoverageIgnore */ public function getTokenizedHeader($header, $token = ';') { Version::warn(__METHOD__ . ' is deprecated. Use $message->getHeader()->parseParams()'); if ($this->hasHeader($header)) { $data = new Collection(); foreach ($this->getHeader($header)->parseParams() as $values) { foreach ($values as $key => $value) { if ($value === '') { $data->set($data->count(), $key); } else { $data->add($key, $value); } } } return $data; } }