bump tests to phpstan level 5 (#1922)
This commit is contained in:
@@ -171,6 +171,9 @@ class DateExtensionsTest extends TestCase
|
||||
$sut = $this->getSut('en', []);
|
||||
$this->assertEquals('2010-01-07T17:43:21+01:00', $sut->dateFormat($date, 'c'));
|
||||
$this->assertStringStartsWith('2010-01-07T17:43:21', $sut->dateFormat('7 January 2010 17:43:21', 'c'));
|
||||
|
||||
// next test checks the fallback for errors while converting the date
|
||||
/* @phpstan-ignore-next-line */
|
||||
$this->assertEquals(2010.0107, $sut->dateFormat(2010.0107, 'c'));
|
||||
}
|
||||
|
||||
@@ -209,6 +212,9 @@ class DateExtensionsTest extends TestCase
|
||||
|
||||
$this->assertEquals('2019-08-17 12:29:47', $sut->dateTimeFull($dateTime));
|
||||
$this->assertEquals('2019-08-17 12:29:47', $sut->dateTimeFull('2019-08-17 12:29:47'));
|
||||
|
||||
// next test checks the fallback for errors while converting the date
|
||||
/* @phpstan-ignore-next-line */
|
||||
$this->assertEquals(189.45, $sut->dateTimeFull(189.45));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,9 @@ class ExtensionsTest extends TestCase
|
||||
$sut = $this->getSut();
|
||||
$this->assertEquals('DateTime', $sut->getClassName(new \DateTime()));
|
||||
$this->assertEquals('stdClass', $sut->getClassName(new \stdClass()));
|
||||
/* @phpstan-ignore-next-line */
|
||||
$this->assertNull($sut->getClassName(''));
|
||||
/* @phpstan-ignore-next-line */
|
||||
$this->assertNull($sut->getClassName(null));
|
||||
$this->assertEquals('App\Entity\User', $sut->getClassName(new User()));
|
||||
}
|
||||
|
||||
@@ -268,11 +268,11 @@ class LocaleExtensionsTest extends TestCase
|
||||
|
||||
// test negative duration
|
||||
$sut = $this->getSut($this->localeEn, 'en');
|
||||
$this->assertEquals('?', $sut->duration('-1'));
|
||||
$this->assertEquals('?', $sut->duration(-1));
|
||||
|
||||
// test zero duration
|
||||
$sut = $this->getSut($this->localeEn, 'en');
|
||||
$this->assertEquals('00:00 h', $sut->duration('0'));
|
||||
$this->assertEquals('00:00 h', $sut->duration(0));
|
||||
|
||||
$sut = $this->getSut($this->localeEn, 'en');
|
||||
|
||||
@@ -296,11 +296,11 @@ class LocaleExtensionsTest extends TestCase
|
||||
|
||||
// test negative duration
|
||||
$sut = $this->getSut($this->localeEn, 'en');
|
||||
$this->assertEquals('0', $sut->durationDecimal('-1'));
|
||||
$this->assertEquals('0', $sut->durationDecimal(-1));
|
||||
|
||||
// test zero duration
|
||||
$sut = $this->getSut($this->localeEn, 'en');
|
||||
$this->assertEquals('0', $sut->durationDecimal('0'));
|
||||
$this->assertEquals('0', $sut->durationDecimal(0));
|
||||
|
||||
$sut = $this->getSut($this->localeEn, 'en');
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ class WidgetExtensionTest extends TestCase
|
||||
$this->expectExceptionMessage('Widget must either implement WidgetInterface or be a string');
|
||||
|
||||
$sut = $this->getSut();
|
||||
/* @phpstan-ignore-next-line */
|
||||
$sut->renderWidget(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user