Add query item to the list does not work
jackdeguest opened this issue · 5 comments
Thank you for providing this class, very useful indeed!
The following advertised on the front page of this project does not work:
// add a new query element called 'zim' with a value of 'gir'
$url->query->zim = 'gir';
When issuing $url->getFull()
it produces only:
https://example.com/something/else/entirely/another.php?baz=dib#anchor
Here is the full test file used.
test_uri.php.zip
Thank you for taking your time playing with the package and reporting this. Apologize for the delay not replying back fast. Didn't got any notification.
I think, we missed to write some test for this at : https://github.com/auraphp/Aura.Uri/blob/a00a2bf2d3e8a014b1beff4c695e72ce6dccd8d7/tests/Aura/Uri/QueryTest.php
Regarding ArrayObject
for the current time you could use something as below .
$url->query['zim'] = 'gir';
$url->query->offsetSet('zim', 'gir');
I have made a fix for this on #29 . But before it is merged it needs tests.
Something is slipping. Tests looks failing at my end :( . I will look into this tomorrow.
This is fixed in #30 . If you are using composer, you can test this via using
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/harikt/Aura.Uri"
}
],
require {
"aura/uri": "dev-patch-issue-28 as 1.2.1"
}
}
via https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository
This is fixed and merged.
If you could test and report back, I will consider tagging another release.