Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XOL-6302 Symfony 4.4 Upgrade #16

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ php:
- 7.4

env:
- SYMFONY_VERSION="2.1"
- SYMFONY_VERSION="3.0"
- SYMFONY_VERSION="3.4"
- SYMFONY_VERSION="4.0"
- SYMFONY_VERSION="4.4"

before_script:
- composer self-update
- composer --version
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update
- composer install -n --dev --prefer-source
- composer install -n --prefer-source

script: phpunit --configuration phpunit.xml.dist
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "xola/reportwriter-bundle",
"description": "A generic report writer",
"require": {
"ext-json": "*",
"php": ">=7.1",
"symfony/framework-bundle": ">=2.1 <4.0",
"symfony/framework-bundle": ">=2.1",
"psr/log": "~1.0",
"phpoffice/phpspreadsheet": "^1.3"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- { name: monolog.logger, channel: csvwriter }

excelwriter:
class: %excelwriter.service.class%
class: "%excelwriter.service.class%"
arguments: [ "@logger", "@phpexcel" ]
tags:
- { name: monolog.logger, channel: excelwriter }
Expand Down
5 changes: 5 additions & 0 deletions src/Service/ExcelWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,9 @@ private function incrementColumn($str, $count = 1)

return $str;
}

public function getCurrentRow(): int
{
return $this->currentRow;
}
}
6 changes: 2 additions & 4 deletions test/Service/ExcelWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public function testShouldSetCurrentWorksheet()
{
$index = 0;
$title = 'Hello World';

// Setup all the mocks
$worksheetMock = $this->getMockBuilder('\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet')->disableOriginalConstructor()->getMock();
$worksheetMock = $this->getMockBuilder(Worksheet::class)->disableOriginalConstructor()->getMock();
$worksheetMock->expects($this->once())->method('setTitle')->with($title);
$this->spreadsheet->expects($this->once())->method('getActiveSheet')->willReturn($worksheetMock);
$this->spreadsheet->expects($this->once())->method('createSheet')->with($index);
Expand All @@ -71,7 +69,7 @@ public function testShouldSetCurrentWorksheet()
$service = $this->buildService();

$service->setWorksheet($index, $title);
$this->assertAttributeEquals(1, 'currentRow', $service, 'Row should be reset to 1 when switching active sheets');
$this->assertEquals(1, $service->getCurrentRow(), 'Row should be reset to 1 when switching active sheets');
}

public function testShouldWriteSingleRowHeaders()
Expand Down