upgraded to phpunit 8 (#1155)
This commit is contained in:
@@ -25,12 +25,11 @@ class TimesheetSubscriberTest extends TestCase
|
||||
$this->assertTrue(in_array(Events::onFlush, $events));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage Invalid TimesheetCalculator implementation given. Expected CalculatorInterface but received stdClass
|
||||
*/
|
||||
public function testConstructThrowsExceptionOnInvalidParam()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Invalid TimesheetCalculator implementation given. Expected CalculatorInterface but received stdClass');
|
||||
|
||||
new TimesheetSubscriber([new \stdClass()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ use App\Doctrine\UTCDateTimeType;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\MySqlPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Types\ConversionException;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -83,10 +84,11 @@ class UTCDateTimeTypeTest extends TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider getPlatforms
|
||||
* @expectedException \Doctrine\DBAL\Types\ConversionException
|
||||
*/
|
||||
public function testConvertToPHPValueWithInvalidValue(AbstractPlatform $platform)
|
||||
{
|
||||
$this->expectException(ConversionException::class);
|
||||
|
||||
Type::overrideType(Type::DATETIME, UTCDateTimeType::class);
|
||||
/** @var UTCDateTimeType $type */
|
||||
$type = Type::getType(Type::DATETIME);
|
||||
|
||||
Reference in New Issue
Block a user