Fixed tests

This commit is contained in:
Alejandro Celaya 2017-10-22 09:17:19 +02:00
parent cb23d38b38
commit 9fb07f4039
2 changed files with 12 additions and 7 deletions

View File

@ -205,18 +205,18 @@ class ShortUrl extends AbstractEntity implements \JsonSerializable
}
/**
* @return int
* @return int|null
*/
public function getMaxVisits(): int
public function getMaxVisits()
{
return $this->maxVisits;
}
/**
* @param int $maxVisits
* @param int|null $maxVisits
* @return $this|self
*/
public function setMaxVisits(int $maxVisits): self
public function setMaxVisits($maxVisits): self
{
$this->maxVisits = $maxVisits;
return $this;

View File

@ -87,9 +87,14 @@ class CreateShortcodeActionTest extends TestCase
*/
public function nonUniqueSlugReturnsError()
{
$this->urlShortener->urlToShortCode(Argument::type(Uri::class), Argument::type('array'), null, null, 'foo')
->willThrow(NonUniqueSlugException::class)
->shouldBeCalledTimes(1);
$this->urlShortener->urlToShortCode(
Argument::type(Uri::class),
Argument::type('array'),
null,
null,
'foo',
Argument::cetera()
)->willThrow(NonUniqueSlugException::class)->shouldBeCalledTimes(1);
$request = ServerRequestFactory::fromGlobals()->withParsedBody([
'longUrl' => 'http://www.domain.com/foo/bar',