upgraded to phpunit 8 (#1155)
This commit is contained in:
@@ -96,10 +96,11 @@ class DurationTest extends TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider getParseDurationInvalidData
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testParseDurationThrowsInvalidArgumentException($duration, $mode)
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
$sut = new Duration();
|
||||
$sut->parseDuration($duration, $mode);
|
||||
}
|
||||
|
||||
@@ -11,18 +11,18 @@ namespace App\Tests\Utils;
|
||||
|
||||
use App\Utils\File;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Filesystem\Exception\FileNotFoundException;
|
||||
|
||||
/**
|
||||
* @covers \App\Utils\File
|
||||
*/
|
||||
class FileTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Filesystem\Exception\FileNotFoundException
|
||||
* @expectedExceptionMessage Unknown file "/kjhgkjhg/jkhgkjhg"
|
||||
*/
|
||||
public function testGetPermissionsOnNonExistingFile()
|
||||
{
|
||||
$this->expectException(FileNotFoundException::class);
|
||||
$this->expectExceptionMessage('Unknown file "/kjhgkjhg/jkhgkjhg"');
|
||||
|
||||
$sut = new File();
|
||||
$sut->getPermissions('/kjhgkjhg/jkhgkjhg');
|
||||
}
|
||||
|
||||
@@ -119,21 +119,19 @@ class LocaleSettingsTest extends TestCase
|
||||
$this->assertEquals(['de', 'en', 'pt_BR', 'it', 'fr', 'es', 'ru', 'ar', 'hu'], $sut->getAvailableLanguages());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidLocaleWithDefaultLocale()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
|
||||
$sut = $this->getSut('en', []);
|
||||
$sut->getDateFormat();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Unknown locale given: xx
|
||||
*/
|
||||
public function testInvalidLocaleWithGivenLocale()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown locale given: xx');
|
||||
|
||||
$sut = $this->getSut('xx', $this->getDefaultSettings());
|
||||
$sut->getDateFormat();
|
||||
}
|
||||
@@ -192,12 +190,11 @@ class LocaleSettingsTest extends TestCase
|
||||
$this->assertEquals('H:i:s', $sut->getTimeFormat());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Unknown setting for locale en: date_time_type
|
||||
*/
|
||||
public function testUnknownSetting()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown setting for locale en: date_time_type');
|
||||
|
||||
$sut = $this->getSut('en', ['en' => [
|
||||
'xxx' => 'dd.MM.yyyy HH:mm',
|
||||
]]);
|
||||
|
||||
Reference in New Issue
Block a user