fix behaviour of HTTP/Request get
This commit is contained in:
parent
86e41e2949
commit
f8807c4efb
|
@ -38,9 +38,9 @@ class Request extends SymfonyRequest
|
||||||
*/
|
*/
|
||||||
public function has($key)
|
public function has($key)
|
||||||
{
|
{
|
||||||
$value = $this->input($key);
|
$value = $this->input($key, null);
|
||||||
|
|
||||||
return !empty($value);
|
return !($value === null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -47,7 +47,8 @@ class RequestTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertTrue($request->has('foo'));
|
$this->assertTrue($request->has('foo'));
|
||||||
$this->assertFalse($request->has('bar'));
|
$this->assertTrue($request->has('bar'));
|
||||||
|
$this->assertFalse($request->has('baz'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue