From 3ccde2b6523615a08fb6d649b6d7792c4ebc3ac9 Mon Sep 17 00:00:00 2001 From: Anush Ramani Date: Thu, 12 Aug 2021 11:52:41 -0700 Subject: [PATCH 1/5] XOL-6302 removed dependency on symfony framework bundle < 4.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 396ff9b..64a84db 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "A generic report writer", "require": { "php": ">=7.1", - "symfony/framework-bundle": ">=2.1 <4.0", + "symfony/framework-bundle": ">=2.1", "psr/log": "~1.0", "phpoffice/phpspreadsheet": "^1.3" }, From 596e67479dc3bce0afa4a396eaaa137623ffb829 Mon Sep 17 00:00:00 2001 From: Anush Ramani Date: Mon, 16 Aug 2021 12:09:30 -0700 Subject: [PATCH 2/5] XOL-6302 run tests on symfony 4.x --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc863ce..57c49f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,9 @@ 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 From 13b5dafee9280ab72c07c6fe264e1be58cd68e8b Mon Sep 17 00:00:00 2001 From: Anush Ramani Date: Mon, 16 Aug 2021 12:11:08 -0700 Subject: [PATCH 3/5] XOL-6302 fix phpunit deprecations --- composer.json | 1 + src/Service/ExcelWriter.php | 5 +++++ test/Service/ExcelWriterTest.php | 6 ++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 64a84db..72e84c0 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "xola/reportwriter-bundle", "description": "A generic report writer", "require": { + "ext-json": "*", "php": ">=7.1", "symfony/framework-bundle": ">=2.1", "psr/log": "~1.0", diff --git a/src/Service/ExcelWriter.php b/src/Service/ExcelWriter.php index 22c3302..29ba511 100644 --- a/src/Service/ExcelWriter.php +++ b/src/Service/ExcelWriter.php @@ -376,4 +376,9 @@ private function incrementColumn($str, $count = 1) return $str; } + + public function getCurrentRow(): int + { + return $this->currentRow; + } } diff --git a/test/Service/ExcelWriterTest.php b/test/Service/ExcelWriterTest.php index fe100ec..f395b41 100644 --- a/test/Service/ExcelWriterTest.php +++ b/test/Service/ExcelWriterTest.php @@ -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); @@ -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() From 9d0a0872543eb8b2f7eb4b5572e59005f6d75371 Mon Sep 17 00:00:00 2001 From: Anush Ramani Date: Mon, 16 Aug 2021 13:21:36 -0700 Subject: [PATCH 4/5] XOL-6302 removed composer deprecated param --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 57c49f7..47def81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,6 @@ 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 From 21dea8668a39eac2726d5f17c1f282b07a3afc3b Mon Sep 17 00:00:00 2001 From: sachin patil Date: Tue, 14 Sep 2021 02:34:16 +0530 Subject: [PATCH 5/5] Update services.yml --- src/Resources/config/services.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml index 246e7af..7a111e0 100644 --- a/src/Resources/config/services.yml +++ b/src/Resources/config/services.yml @@ -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 }