コード例 #1
0
 public function testRemove()
 {
     $this->assertEquals('world', $this->bag->get('hello'));
     $this->bag->remove('hello');
     $this->assertNull($this->bag->get('hello'));
     $this->assertEquals('be happy', $this->bag->get('always'));
     $this->bag->remove('always');
     $this->assertNull($this->bag->get('always'));
     $this->assertEquals('drak', $this->bag->get('user.login'));
     $this->bag->remove('user.login');
     $this->assertNull($this->bag->get('user.login'));
 }
コード例 #2
0
 /**
  * @return string
  */
 public function getCurrentRequestUri()
 {
     $uri = $this->attributeBag->get('current_uri');
     $this->attributeBag->remove('current_uri');
     return $uri;
 }
コード例 #3
0
 public function testRemoveNonexistingNamespacedAttribute()
 {
     $this->assertNull($this->bag->remove('foo/bar/baz'));
 }
コード例 #4
0
 public function clear()
 {
     $this->attributeBag->remove($this->provider);
 }