Release 2.12 (#4609)
This commit is contained in:
@@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class AnnotatedObjectExporterTest extends TestCase
|
||||
{
|
||||
public function testExport()
|
||||
public function testExport(): void
|
||||
{
|
||||
$spreadsheetExporter = new SpreadsheetExporter($this->createMock(TranslatorInterface::class));
|
||||
$annotationExtractor = new AnnotationExtractor();
|
||||
|
||||
@@ -23,16 +23,16 @@ abstract class AbstractFormatterTest extends TestCase
|
||||
|
||||
abstract protected function getExpectedValue();
|
||||
|
||||
protected function assertCellStyle(Style $style)
|
||||
public function assertCellStyle(Style $style): void
|
||||
{
|
||||
}
|
||||
|
||||
protected function assertCellValue(Cell $cell)
|
||||
public function assertCellValue(Cell $cell): void
|
||||
{
|
||||
self::assertEquals($this->getExpectedValue(), $cell->getValue());
|
||||
}
|
||||
|
||||
public function testSetFormattedValue()
|
||||
public function testSetFormattedValue(): void
|
||||
{
|
||||
$sut = $this->getFormatter();
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract class AbstractFormatterTest extends TestCase
|
||||
$this->assertCellStyle($worksheet->getStyleByColumnAndRow(1, 1));
|
||||
}
|
||||
|
||||
public function testSetNull()
|
||||
public function testSetNull(): void
|
||||
{
|
||||
$sut = $this->getFormatter();
|
||||
|
||||
@@ -57,7 +57,7 @@ abstract class AbstractFormatterTest extends TestCase
|
||||
$this->assertNullValue($cell);
|
||||
}
|
||||
|
||||
protected function assertNullValue(Cell $cell)
|
||||
public function assertNullValue(Cell $cell): void
|
||||
{
|
||||
self::assertEquals('', $cell->getValue());
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class ArrayFormatterTest extends AbstractFormatterTest
|
||||
return 'test;foo;bar';
|
||||
}
|
||||
|
||||
public function testFormattedValueWithInvalidValue()
|
||||
public function testFormattedValueWithInvalidValue(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unsupported value given, only array is supported');
|
||||
|
||||
@@ -33,7 +33,7 @@ class BooleanFormatterTest extends AbstractFormatterTest
|
||||
return false;
|
||||
}
|
||||
|
||||
public function testFormattedValueWithInvalidValue()
|
||||
public function testFormattedValueWithInvalidValue(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unsupported value given, only boolean is supported');
|
||||
|
||||
@@ -38,7 +38,7 @@ class DateFormatterTest extends AbstractFormatterTest
|
||||
return Date::PHPToExcel($this->date);
|
||||
}
|
||||
|
||||
public function testFormattedValueWithInvalidValue()
|
||||
public function testFormattedValueWithInvalidValue(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unsupported value given, only DateTimeInterface is supported');
|
||||
@@ -50,7 +50,7 @@ class DateFormatterTest extends AbstractFormatterTest
|
||||
$sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf');
|
||||
}
|
||||
|
||||
protected function assertCellStyle(Style $style)
|
||||
public function assertCellStyle(Style $style): void
|
||||
{
|
||||
self::assertEquals(NumberFormat::FORMAT_DATE_YYYYMMDD2, $style->getNumberFormat()->getFormatCode());
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class DateTimeFormatterTest extends AbstractFormatterTest
|
||||
return Date::PHPToExcel($this->date);
|
||||
}
|
||||
|
||||
public function testFormattedValueWithInvalidValue()
|
||||
public function testFormattedValueWithInvalidValue(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unsupported value given, only DateTimeInterface is supported');
|
||||
@@ -49,7 +49,7 @@ class DateTimeFormatterTest extends AbstractFormatterTest
|
||||
$sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf');
|
||||
}
|
||||
|
||||
protected function assertCellStyle(Style $style)
|
||||
public function assertCellStyle(Style $style): void
|
||||
{
|
||||
self::assertEquals(DateTimeFormatter::DATETIME_FORMAT, $style->getNumberFormat()->getFormatCode());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class DurationFormatterTest extends AbstractFormatterTest
|
||||
return '=3600/86400';
|
||||
}
|
||||
|
||||
public function testFormattedValueWithInvalidValue()
|
||||
public function testFormattedValueWithInvalidValue(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unsupported value given, only int is supported');
|
||||
@@ -47,12 +47,12 @@ class DurationFormatterTest extends AbstractFormatterTest
|
||||
$sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf');
|
||||
}
|
||||
|
||||
protected function assertNullValue(Cell $cell)
|
||||
public function assertNullValue(Cell $cell): void
|
||||
{
|
||||
self::assertEquals('=0/86400', $cell->getValue());
|
||||
}
|
||||
|
||||
protected function assertCellStyle(Style $style)
|
||||
public function assertCellStyle(Style $style): void
|
||||
{
|
||||
self::assertEquals(DurationFormatter::DURATION_FORMAT, $style->getNumberFormat()->getFormatCode());
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class TimeFormatterTest extends AbstractFormatterTest
|
||||
return Date::PHPToExcel($this->date);
|
||||
}
|
||||
|
||||
public function testFormattedValueWithInvalidValue()
|
||||
public function testFormattedValueWithInvalidValue(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unsupported value given, only DateTimeInterface is supported');
|
||||
@@ -49,7 +49,7 @@ class TimeFormatterTest extends AbstractFormatterTest
|
||||
$sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf');
|
||||
}
|
||||
|
||||
protected function assertCellStyle(Style $style)
|
||||
public function assertCellStyle(Style $style): void
|
||||
{
|
||||
self::assertEquals(TimeFormatter::TIME_FORMAT, $style->getNumberFormat()->getFormatCode());
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class ColumnDefinitionTest extends TestCase
|
||||
{
|
||||
public function testConstruct()
|
||||
public function testConstruct(): void
|
||||
{
|
||||
$sut = new \App\Export\Spreadsheet\ColumnDefinition('foo', 'bar', function () {
|
||||
return 'hello world';
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class EntityWithMetaFieldsExporterTest extends TestCase
|
||||
{
|
||||
public function testExport()
|
||||
public function testExport(): void
|
||||
{
|
||||
$dispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||
$dispatcher->expects(self::once())->method('dispatch')->willReturnCallback(function (ProjectMetaDisplayEvent $event) {
|
||||
|
||||
@@ -28,7 +28,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class AnnotationExtractorTest extends TestCase
|
||||
{
|
||||
public function testExtract()
|
||||
public function testExtract(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -70,7 +70,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testExceptionOnInvalidType()
|
||||
public function testExceptionOnInvalidType(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -81,7 +81,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$sut->extract(new \stdClass());
|
||||
}
|
||||
|
||||
public function testExceptionOnEmptyString()
|
||||
public function testExceptionOnEmptyString(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -91,7 +91,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$sut->extract('');
|
||||
}
|
||||
|
||||
public function testExceptionOnMissingExpression()
|
||||
public function testExceptionOnMissingExpression(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -101,7 +101,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$sut->extract(MissingExpressionOnClass::class);
|
||||
}
|
||||
|
||||
public function testExceptionOnMissingName()
|
||||
public function testExceptionOnMissingName(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -111,7 +111,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$sut->extract(MissingNameOnClass::class);
|
||||
}
|
||||
|
||||
public function testExceptionExpressionOnProperty()
|
||||
public function testExceptionExpressionOnProperty(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -121,7 +121,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$sut->extract(ExpressionOnProperty::class);
|
||||
}
|
||||
|
||||
public function testExceptionExpressionOnMethod()
|
||||
public function testExceptionExpressionOnMethod(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
@@ -131,7 +131,7 @@ class AnnotationExtractorTest extends TestCase
|
||||
$sut->extract(ExpressionOnMethod::class);
|
||||
}
|
||||
|
||||
public function testExceptionExpressionOnMethodWithRequiredParameters()
|
||||
public function testExceptionExpressionOnMethodWithRequiredParameters(): void
|
||||
{
|
||||
$sut = new AnnotationExtractor();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
*/
|
||||
class MetaFieldExtractorTest extends TestCase
|
||||
{
|
||||
public function testExtract()
|
||||
public function testExtract(): void
|
||||
{
|
||||
$dispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||
$dispatcher->expects(self::once())->method('dispatch')->willReturnCallback(function (ProjectMetaDisplayEvent $event) {
|
||||
@@ -55,7 +55,7 @@ class MetaFieldExtractorTest extends TestCase
|
||||
self::assertEquals('tralalalala', \call_user_func($definition->getAccessor(), (new Project())->setMetaField((new ProjectMeta())->setName('bar')->setValue('tralalalala'))));
|
||||
}
|
||||
|
||||
public function testCheckType()
|
||||
public function testCheckType(): void
|
||||
{
|
||||
$dispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||
$sut = new MetaFieldExtractor($dispatcher);
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
*/
|
||||
class UserPreferenceExtractorTest extends TestCase
|
||||
{
|
||||
public function testExtract()
|
||||
public function testExtract(): void
|
||||
{
|
||||
$dispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||
$dispatcher->expects(self::once())->method('dispatch')->willReturnCallback(function (UserPreferenceDisplayEvent $event) {
|
||||
@@ -54,7 +54,7 @@ class UserPreferenceExtractorTest extends TestCase
|
||||
self::assertEquals('tralalalala', \call_user_func($definition->getAccessor(), (new User())->addPreference((new UserPreference('bar', 'tralalalala')))));
|
||||
}
|
||||
|
||||
public function testCheckType()
|
||||
public function testCheckType(): void
|
||||
{
|
||||
$dispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||
$sut = new UserPreferenceExtractor($dispatcher);
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class SpreadsheetExporterTest extends TestCase
|
||||
{
|
||||
public function testExport()
|
||||
public function testExport(): void
|
||||
{
|
||||
$sut = new SpreadsheetExporter($this->createMock(TranslatorInterface::class));
|
||||
$sut->registerCellFormatter('foo', new class() implements CellFormatterInterface {
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class UserExporterTest extends TestCase
|
||||
{
|
||||
public function testExport()
|
||||
public function testExport(): void
|
||||
{
|
||||
$spreadsheetExporter = new SpreadsheetExporter($this->createMock(TranslatorInterface::class));
|
||||
$annotationExtractor = new AnnotationExtractor();
|
||||
|
||||
@@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class BinaryFileResponseWriterTest extends TestCase
|
||||
{
|
||||
public function testSave()
|
||||
public function testSave(): void
|
||||
{
|
||||
$sut = new BinaryFileResponseWriter(new XlsxWriter(), 'foobar');
|
||||
|
||||
@@ -33,7 +33,7 @@ class BinaryFileResponseWriterTest extends TestCase
|
||||
self::assertTrue(file_exists($file->getRealPath()));
|
||||
}
|
||||
|
||||
public function testGetResponse()
|
||||
public function testGetResponse(): void
|
||||
{
|
||||
$sut = new BinaryFileResponseWriter(new XlsxWriter(), 'foobar');
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class XlsxWriterTest extends TestCase
|
||||
{
|
||||
public function testWriter()
|
||||
public function testWriter(): void
|
||||
{
|
||||
$sut = new XlsxWriter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user