Skip to content

Commit

Permalink
XOL-6302 Symfony 4.4 Upgrade (#14)
Browse files Browse the repository at this point in the history
* XOL-6302 removed dependency on symfony framework bundle < 4.0

* XOL-6302 run tests on symfony 4.x

* XOL-6302 fix phpunit deprecations

* XOL-6302 removed composer deprecated param
  • Loading branch information
anush authored Aug 3, 2023
1 parent 9b3e009 commit 3294cbc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
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
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

0 comments on commit 3294cbc

Please sign in to comment.