Inheritance: use trait Webiny\Component\StdLib\StdLibTrait
Example #1
0
 /**
  * Get a value from $_POST param for the given $key.
  * If key doesn't not exist, $value will be returned and assigned under that key.
  *
  * @param string $key   Key for which you wish to get the value.
  * @param mixed  $value Default value that will be returned if $key doesn't exist.
  *
  * @return mixed Value of the given $key.
  */
 public function post($key = null, $value = null)
 {
     return $this->isNull($key) ? $this->post->getAll() : $this->post->get($key, $value);
 }
Example #2
0
 public function testGetAll()
 {
     $_POST = ["name" => "jack", "surname" => "doe"];
     $post = new Post();
     $this->assertSame($_POST, $post->getAll());
 }