Skip to content

Commit

Permalink
updated readme and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Wagner committed Mar 12, 2018
1 parent 0776432 commit 914928d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Use the following alternatives for contao `Input` or `Environment` calls
Contao | Request
---- | -----------
`\Input::get($strKey)` | `\Contao\System->getContainer->get('huh.request')->getGet($strKey)`
`\Input::post($strKey)` | `\Contao\System->getContainer->get('huh.request')->:getPost($strKey)`
`\Input::post($strKey)` | `\Contao\System->getContainer->get('huh.request')->getPost($strKey)`
`\Input::postHtml($strKey)` | `\Contao\System->getContainer->get('huh.request')->getPostHtml($strKey)`
`\Input::postRaw($strKey)` | `\Contao\System->getContainer->get('huh.request')->:getPostRaw($strKey)`
`\Input::postRaw($strKey)` | `\Contao\System->getContainer->get('huh.request')->getPostRaw($strKey)`
`\Input::setPost($strKey, $varValue)` | `\Contao\System->getContainer->get('huh.request')->setPost($strKey, $varValue)`
`\Input::setGet($strKey, $varValue)` | `\Contao\System->getContainer->get('huh.request')->setGet($strKey, $varValue)`
`isset($_GET[$strKey])` | `\Contao\System->getContainer->get('huh.request')->hasGet($strKey)`
Expand All @@ -32,7 +32,7 @@ Contao | Request

For convenience we provide insert tags for some request method parameters.

**CAUTION: If you use the insert tags in SQL-Query Context, be sure that you escape the insert tag values by using e.g. `prepare('field=?'')->execute('{{request_get::auto_item}}'')` **
**CAUTION: If you use the insert tags in SQL-Query Context, be sure that you escape the insert tag values by using e.g. `prepare('field=?')->execute('{{request_get::auto_item}}')`**


Insert tag | Description
Expand Down
6 changes: 3 additions & 3 deletions tests/Component/HttpFoundation/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Contao\System;
use Contao\TestCase\ContaoTestCase;
use HeimrichHannot\RequestBundle\Component\HttpFoundation\Request;
use HeimrichHannot\UtilsBundle\Container\ContainerUtil;
use Symfony\Component\HttpFoundation\RequestMatcher;
use Symfony\Component\HttpFoundation\RequestStack;

Expand Down Expand Up @@ -48,8 +47,6 @@ public function setUp()
$this->request = new Request($this->mockContaoFramework(), $requestStack, $scopeMatcher);

$container = $this->mockContainer();
$container->set('huh.utils.container', new ContainerUtil($this->mockContaoFramework()));

// request stack
$request = new \Symfony\Component\HttpFoundation\Request();
$requestStack = new RequestStack();
Expand Down Expand Up @@ -160,6 +157,9 @@ public function testGetAllPost()
$result = $this->request->getAllPost();
$this->assertSame(['test' => ['id' => '12']], $result);

$result = $this->request->getAllPostHtml();
$this->assertSame(['test' => ['id' => '12']], $result);

$result = $this->request->getAllPostRaw();
$this->assertSame(['test' => ['id' => '12']], $result);

Expand Down

0 comments on commit 914928d

Please sign in to comment.