Inheritance: extends ValueObjects\Structure\Collection
Beispiel #1
0
 public function testContainsValue()
 {
     $one = new StringLiteral('one');
     $ten = new StringLiteral('ten');
     $this->assertTrue($this->dictionary->containsValue($one));
     $this->assertFalse($this->dictionary->containsValue($ten));
 }
 public function testToDictionary()
 {
     $query = new QueryString('?foo=bar&array[]=one&array[]=two');
     $dictionary = $query->toDictionary();
     $this->assertInstanceOf('ValueObjects\\Structure\\Dictionary', $dictionary);
     $array = array('foo' => 'bar', 'array' => array('one', 'two'));
     $expectedDictionary = Dictionary::fromNative($array);
     $this->assertTrue($expectedDictionary->sameValueAs($dictionary));
 }
Beispiel #3
0
 /**
  * Returns a Dictionary structured representation of the query string
  *
  * @return Dictionary
  */
 public function toDictionary()
 {
     $value = \ltrim($this->toNative(), '?');
     \parse_str($value, $data);
     return Dictionary::fromNative($data);
 }