public function testGetSetAttributes() { $request = new Request(new Url('http://127.0.0.1'), 'POST'); $request->setAttribute('foo', 'bar'); $this->assertEquals('bar', $request->getAttribute('foo')); $this->assertEquals(null, $request->getAttribute('bar')); $this->assertEquals(array('foo' => 'bar'), $request->getAttributes()); $request->setAttribute('bar', 'foo'); $this->assertEquals('foo', $request->getAttribute('bar')); $this->assertEquals(array('foo' => 'bar', 'bar' => 'foo'), $request->getAttributes()); $request->removeAttribute('bar'); $request->removeAttribute('fooo'); // unknown value $this->assertEquals(null, $request->getAttribute('bar')); }