lint container, workflows and composer update (#2591)
This commit is contained in:
7
.github/workflows/coverage.yaml
vendored
7
.github/workflows/coverage.yaml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
matrix:
|
||||
php: ['7.4']
|
||||
|
||||
name: PHP ${{ matrix.php }}
|
||||
name: Coverage (${{ matrix.php }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: shivammathur/setup-php@v2
|
||||
@@ -29,9 +29,8 @@ jobs:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: pcov
|
||||
extensions: mbstring, xml, ctype, iconv, intl, mysql, zip, gd, ldap
|
||||
- run: |
|
||||
composer install --no-progress
|
||||
composer require laminas/laminas-ldap
|
||||
- uses: ramsey/composer-install@v1
|
||||
- run: composer require laminas/laminas-ldap
|
||||
- name: Setup problem matchers for PHPUnit
|
||||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
||||
- name: Run tests
|
||||
|
||||
28
.github/workflows/linting.yaml
vendored
28
.github/workflows/linting.yaml
vendored
@@ -1,28 +0,0 @@
|
||||
name: Linting
|
||||
on:
|
||||
pull_request: null
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['7.4', '8.0']
|
||||
|
||||
name: PHP ${{ matrix.php }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
extensions: mbstring, xml, ctype, iconv, intl, mysql, zip, gd, ldap
|
||||
tools: cs2pr:1.1.0
|
||||
- run: composer install --no-progress
|
||||
- run: composer validate --strict
|
||||
- run: vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr
|
||||
- run: vendor/bin/phpstan analyse src -c phpstan.neon --level=5 --no-progress --error-format=checkstyle | cs2pr
|
||||
- run: vendor/bin/phpstan analyse tests -c tests/phpstan.neon --level=5 --no-progress --error-format=checkstyle | cs2pr
|
||||
- run: composer kimai:code-lint
|
||||
41
.github/workflows/testing.yaml
vendored
41
.github/workflows/testing.yaml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
tests:
|
||||
integration:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
@@ -21,31 +21,58 @@ jobs:
|
||||
matrix:
|
||||
php: ['7.3', '7.4', '8.0']
|
||||
|
||||
name: PHP ${{ matrix.php }}
|
||||
name: Integration (${{ matrix.php }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: shivammathur/setup-php@v2
|
||||
|
||||
- name: Clone Kimai
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
extensions: mbstring, xml, ctype, iconv, intl, mysql, zip, gd, ldap
|
||||
- run: |
|
||||
composer install --no-progress
|
||||
composer require laminas/laminas-ldap
|
||||
tools: cs2pr:1.1.0
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ramsey/composer-install@v1
|
||||
|
||||
- name: Validate Composer
|
||||
run: composer validate --strict
|
||||
|
||||
- name: Check codestyles
|
||||
run: vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr
|
||||
|
||||
- name: Run PHPStan on Codebase
|
||||
run: vendor/bin/phpstan analyse src -c phpstan.neon --level=5 --no-progress --error-format=checkstyle | cs2pr
|
||||
|
||||
- name: Run PHPStan on Tests
|
||||
run: vendor/bin/phpstan analyse tests -c tests/phpstan.neon --level=5 --no-progress --error-format=checkstyle | cs2pr
|
||||
|
||||
- name: Lint codebase
|
||||
run: composer kimai:code-lint
|
||||
|
||||
- name: Install LDAP package
|
||||
run: composer require laminas/laminas-ldap
|
||||
|
||||
- name: Setup problem matchers for PHPUnit
|
||||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
||||
|
||||
- name: Run unit tests
|
||||
run: composer kimai:tests-unit
|
||||
env:
|
||||
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
|
||||
APP_ENV: dev
|
||||
MAILER_URL: null://localhost
|
||||
|
||||
- name: Run integration tests
|
||||
run: composer kimai:tests-integration
|
||||
env:
|
||||
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
|
||||
APP_ENV: dev
|
||||
MAILER_URL: null://localhost
|
||||
|
||||
- name: Run migrations on MySQL
|
||||
run: |
|
||||
bin/console doctrine:database:drop --if-exists --force -n
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
],
|
||||
"kimai:code-lint": [
|
||||
"composer validate --strict",
|
||||
"bin/console lint:container",
|
||||
"bin/console lint:yaml config --parse-tags",
|
||||
"bin/console lint:twig templates --show-deprecations",
|
||||
"bin/console lint:xliff translations",
|
||||
|
||||
66
composer.lock
generated
66
composer.lock
generated
@@ -1303,22 +1303,22 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/orm",
|
||||
"version": "2.9.1",
|
||||
"version": "2.9.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/orm.git",
|
||||
"reference": "f3e55fae9fdbdbc23897006bdbf016c20e11f6e9"
|
||||
"reference": "75b4b88c5b7cebc24ed7251a20c2a5aa027300e1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/orm/zipball/f3e55fae9fdbdbc23897006bdbf016c20e11f6e9",
|
||||
"reference": "f3e55fae9fdbdbc23897006bdbf016c20e11f6e9",
|
||||
"url": "https://api.github.com/repos/doctrine/orm/zipball/75b4b88c5b7cebc24ed7251a20c2a5aa027300e1",
|
||||
"reference": "75b4b88c5b7cebc24ed7251a20c2a5aa027300e1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer/package-versions-deprecated": "^1.8",
|
||||
"doctrine/annotations": "^1.13",
|
||||
"doctrine/cache": "^1.11|^2.0",
|
||||
"doctrine/cache": "^1.11.3|^2.0.3",
|
||||
"doctrine/collections": "^1.5",
|
||||
"doctrine/common": "^3.0.3",
|
||||
"doctrine/dbal": "^2.13.0",
|
||||
@@ -1389,9 +1389,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/orm/issues",
|
||||
"source": "https://github.com/doctrine/orm/tree/2.9.1"
|
||||
"source": "https://github.com/doctrine/orm/tree/2.9.2"
|
||||
},
|
||||
"time": "2021-05-24T15:54:12+00:00"
|
||||
"time": "2021-05-31T09:53:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/persistence",
|
||||
@@ -2918,16 +2918,16 @@
|
||||
},
|
||||
{
|
||||
"name": "kimai/user-bundle",
|
||||
"version": "2.0",
|
||||
"version": "2.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kimai/user-bundle.git",
|
||||
"reference": "9ef2c93a4ed9d14f0e354d88bd5fc7ab68c86c16"
|
||||
"reference": "c618bf9f2440034d639adf6967f8f7dbc33d5b16"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/kimai/user-bundle/zipball/9ef2c93a4ed9d14f0e354d88bd5fc7ab68c86c16",
|
||||
"reference": "9ef2c93a4ed9d14f0e354d88bd5fc7ab68c86c16",
|
||||
"url": "https://api.github.com/repos/kimai/user-bundle/zipball/c618bf9f2440034d639adf6967f8f7dbc33d5b16",
|
||||
"reference": "c618bf9f2440034d639adf6967f8f7dbc33d5b16",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2980,9 +2980,9 @@
|
||||
"description": "Kimai UserBundle",
|
||||
"homepage": "https://www.kimai.org",
|
||||
"support": {
|
||||
"source": "https://github.com/kimai/user-bundle/tree/2.0"
|
||||
"source": "https://github.com/kimai/user-bundle/tree/2.0.1"
|
||||
},
|
||||
"time": "2021-05-30T10:30:27+00:00"
|
||||
"time": "2021-05-31T20:26:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laminas/laminas-code",
|
||||
@@ -4665,16 +4665,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpspreadsheet",
|
||||
"version": "1.17.1",
|
||||
"version": "1.18.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
|
||||
"reference": "c55269cb06911575a126dc225a05c0e4626e5fb4"
|
||||
"reference": "418cd304e8e6b417ea79c3b29126a25dc4b1170c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c55269cb06911575a126dc225a05c0e4626e5fb4",
|
||||
"reference": "c55269cb06911575a126dc225a05c0e4626e5fb4",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/418cd304e8e6b417ea79c3b29126a25dc4b1170c",
|
||||
"reference": "418cd304e8e6b417ea79c3b29126a25dc4b1170c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4693,20 +4693,23 @@
|
||||
"ext-zlib": "*",
|
||||
"ezyang/htmlpurifier": "^4.13",
|
||||
"maennchen/zipstream-php": "^2.1",
|
||||
"markbaker/complex": "^1.5||^2.0",
|
||||
"markbaker/matrix": "^1.2||^2.0",
|
||||
"php": "^7.2||^8.0",
|
||||
"markbaker/complex": "^2.0",
|
||||
"markbaker/matrix": "^2.0",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"psr/http-client": "^1.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/simple-cache": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dompdf/dompdf": "^0.8.5",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
|
||||
"dompdf/dompdf": "^1.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.18",
|
||||
"jpgraph/jpgraph": "^4.0",
|
||||
"mpdf/mpdf": "^8.0",
|
||||
"phpcompatibility/php-compatibility": "^9.3",
|
||||
"phpunit/phpunit": "^8.5||^9.3",
|
||||
"phpstan/phpstan": "^0.12.82",
|
||||
"phpstan/phpstan-phpunit": "^0.12.18",
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"tecnickcom/tcpdf": "^6.3"
|
||||
},
|
||||
@@ -4760,9 +4763,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
|
||||
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.17.1"
|
||||
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.18.0"
|
||||
},
|
||||
"time": "2021-03-02T17:54:11+00:00"
|
||||
"time": "2021-05-31T18:21:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpword",
|
||||
@@ -12615,16 +12618,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-symfony",
|
||||
"version": "0.12.33",
|
||||
"version": "0.12.34",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan-symfony.git",
|
||||
"reference": "7f47026c69c9f2ef8d6b1814bd17cc86ea768e9d"
|
||||
"reference": "716a70de8524928036d5bc0d880d1117fa77de82"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/7f47026c69c9f2ef8d6b1814bd17cc86ea768e9d",
|
||||
"reference": "7f47026c69c9f2ef8d6b1814bd17cc86ea768e9d",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/716a70de8524928036d5bc0d880d1117fa77de82",
|
||||
"reference": "716a70de8524928036d5bc0d880d1117fa77de82",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -12636,11 +12639,10 @@
|
||||
"symfony/framework-bundle": "<3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phing/phing": "^2.16.3",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||
"phpstan/phpstan-phpunit": "^0.12.16",
|
||||
"phpstan/phpstan-strict-rules": "^0.12.5",
|
||||
"phpunit/phpunit": "^7.5.20",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"symfony/config": "^4.2 || ^5.0",
|
||||
"symfony/console": "^4.0 || ^5.0",
|
||||
"symfony/framework-bundle": "^4.4 || ^5.0",
|
||||
@@ -12679,9 +12681,9 @@
|
||||
"description": "Symfony Framework extensions and rules for PHPStan",
|
||||
"support": {
|
||||
"issues": "https://github.com/phpstan/phpstan-symfony/issues",
|
||||
"source": "https://github.com/phpstan/phpstan-symfony/tree/0.12.33"
|
||||
"source": "https://github.com/phpstan/phpstan-symfony/tree/0.12.34"
|
||||
},
|
||||
"time": "2021-05-05T14:52:06+00:00"
|
||||
"time": "2021-05-31T15:46:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
|
||||
@@ -163,57 +163,57 @@ services:
|
||||
# ================================================================================
|
||||
|
||||
App\Repository\TimesheetRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\TimesheetRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Timesheet']
|
||||
|
||||
App\Repository\UserRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\UserRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\User']
|
||||
|
||||
App\Repository\TeamRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\TeamRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Team']
|
||||
|
||||
App\Repository\ActivityRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\ActivityRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Activity']
|
||||
|
||||
App\Repository\ProjectRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\ProjectRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Project']
|
||||
|
||||
App\Repository\TagRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\TagRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Tag']
|
||||
|
||||
App\Repository\CustomerRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\CustomerRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Customer']
|
||||
|
||||
App\Repository\InvoiceTemplateRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\InvoiceTemplateRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\InvoiceTemplate']
|
||||
|
||||
App\Repository\ConfigurationRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\ConfigurationRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Configuration']
|
||||
|
||||
App\Repository\RoleRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\RoleRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Role']
|
||||
|
||||
App\Repository\RolePermissionRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\RolePermissionRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\RolePermission']
|
||||
|
||||
@@ -222,26 +222,26 @@ services:
|
||||
arguments: ['%kimai.invoice.documents%']
|
||||
|
||||
App\Repository\CustomerRateRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\CustomerRateRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\CustomerRate']
|
||||
|
||||
App\Repository\ActivityRateRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\ActivityRateRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\ActivityRate']
|
||||
|
||||
App\Repository\ProjectRateRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\ProjectRateRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\ProjectRate']
|
||||
|
||||
App\Repository\InvoiceRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: App\Repository\InvoiceRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Invoice']
|
||||
|
||||
App\Repository\BookmarkRepository:
|
||||
class: Doctrine\ORM\EntityRepository
|
||||
class: \Repository\BookmarkRepository
|
||||
factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
arguments: ['App\Entity\Bookmark']
|
||||
|
||||
@@ -200,14 +200,19 @@ abstract class AbstractSpreadsheetRenderer
|
||||
$sheet->setCellValueByColumnAndRow($column, $row, sprintf('=SUM(%s:%s)', $startCoordinate, $endCoordinate));
|
||||
}
|
||||
|
||||
protected function setRate(Worksheet $sheet, $column, $row, $rate, $currency)
|
||||
protected function setRateStyle(Worksheet $sheet, $column, $row, $rate, $currency)
|
||||
{
|
||||
$sheet->setCellValueByColumnAndRow($column, $row, $rate);
|
||||
$sheet->getStyleByColumnAndRow($column, $row)->getNumberFormat()->setFormatCode(
|
||||
sprintf(self::RATE_FORMAT_LEFT, $currency)
|
||||
);
|
||||
}
|
||||
|
||||
protected function setRate(Worksheet $sheet, $column, $row, $rate, $currency)
|
||||
{
|
||||
$sheet->setCellValueByColumnAndRow($column, $row, $rate);
|
||||
$this->setRateStyle($sheet, $column, $row, $rate, $currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param MetaDisplayEventInterface $event
|
||||
* @return MetaTableTypeInterface[]
|
||||
|
||||
@@ -58,4 +58,12 @@ class CsvRenderer extends AbstractSpreadsheetRenderer
|
||||
{
|
||||
$sheet->setCellValueByColumnAndRow($column, $row, sprintf('=%s', $duration));
|
||||
}
|
||||
|
||||
protected function setRateStyle(Worksheet $sheet, $column, $row, $rate, $currency)
|
||||
{
|
||||
if ($rate === 0.00) {
|
||||
return;
|
||||
}
|
||||
parent::setRateStyle($sheet, $column, $row, $rate, $currency);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,15 +42,15 @@ class AnnotatedObjectExporterTest extends TestCase
|
||||
$spreadsheet = $sut->export(Project::class, [$project]);
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
self::assertNull($worksheet->getCellByColumnAndRow(1, 2, false)->getValue());
|
||||
self::assertEquals('test project', $worksheet->getCellByColumnAndRow(2, 2, false)->getValue());
|
||||
self::assertEquals('A customer', $worksheet->getCellByColumnAndRow(3, 2, false)->getValue());
|
||||
self::assertEquals(1234567890, $worksheet->getCellByColumnAndRow(4, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(5, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(6, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(7, 2, false)->getValue());
|
||||
self::assertEquals('#ababab', $worksheet->getCellByColumnAndRow(8, 2, false)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2, false)->getValue());
|
||||
self::assertEquals('Lorem Ipsum', $worksheet->getCellByColumnAndRow(10, 2, false)->getValue());
|
||||
self::assertNull($worksheet->getCellByColumnAndRow(1, 2)->getValue());
|
||||
self::assertEquals('test project', $worksheet->getCellByColumnAndRow(2, 2)->getValue());
|
||||
self::assertEquals('A customer', $worksheet->getCellByColumnAndRow(3, 2)->getValue());
|
||||
self::assertEquals(1234567890, $worksheet->getCellByColumnAndRow(4, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(5, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(6, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(7, 2)->getValue());
|
||||
self::assertEquals('#ababab', $worksheet->getCellByColumnAndRow(8, 2)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2)->getValue());
|
||||
self::assertEquals('Lorem Ipsum', $worksheet->getCellByColumnAndRow(10, 2)->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ abstract class AbstractFormatterTest extends TestCase
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
$sut->setFormattedValue($worksheet, 1, 1, $this->getActualValue());
|
||||
$cell = $worksheet->getCellByColumnAndRow(1, 1, false);
|
||||
$cell = $worksheet->getCellByColumnAndRow(1, 1);
|
||||
$this->assertCellValue($cell);
|
||||
$this->assertCellStyle($worksheet->getStyleByColumnAndRow(1, 1));
|
||||
}
|
||||
@@ -53,7 +53,7 @@ abstract class AbstractFormatterTest extends TestCase
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
$sut->setFormattedValue($worksheet, 1, 1, null);
|
||||
$cell = $worksheet->getCellByColumnAndRow(1, 1, false);
|
||||
$cell = $worksheet->getCellByColumnAndRow(1, 1);
|
||||
$this->assertNullValue($cell);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,17 +58,17 @@ class EntityWithMetaFieldsExporterTest extends TestCase
|
||||
$spreadsheet = $sut->export(Project::class, [$project], new ProjectMetaDisplayEvent(new ProjectQuery(), ProjectMetaDisplayEvent::EXPORT));
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
self::assertNull($worksheet->getCellByColumnAndRow(1, 2, false)->getValue());
|
||||
self::assertEquals('test project', $worksheet->getCellByColumnAndRow(2, 2, false)->getValue());
|
||||
self::assertEquals('A customer', $worksheet->getCellByColumnAndRow(3, 2, false)->getValue());
|
||||
self::assertEquals(1234567890, $worksheet->getCellByColumnAndRow(4, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(5, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(6, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(7, 2, false)->getValue());
|
||||
self::assertEquals('#ababab', $worksheet->getCellByColumnAndRow(8, 2, false)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2, false)->getValue());
|
||||
self::assertEquals('Lorem Ipsum', $worksheet->getCellByColumnAndRow(10, 2, false)->getValue());
|
||||
self::assertEquals('some magic', $worksheet->getCellByColumnAndRow(11, 2, false)->getValue());
|
||||
self::assertEquals('is happening', $worksheet->getCellByColumnAndRow(12, 2, false)->getValue());
|
||||
self::assertNull($worksheet->getCellByColumnAndRow(1, 2)->getValue());
|
||||
self::assertEquals('test project', $worksheet->getCellByColumnAndRow(2, 2)->getValue());
|
||||
self::assertEquals('A customer', $worksheet->getCellByColumnAndRow(3, 2)->getValue());
|
||||
self::assertEquals(1234567890, $worksheet->getCellByColumnAndRow(4, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(5, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(6, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(7, 2)->getValue());
|
||||
self::assertEquals('#ababab', $worksheet->getCellByColumnAndRow(8, 2)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2)->getValue());
|
||||
self::assertEquals('Lorem Ipsum', $worksheet->getCellByColumnAndRow(10, 2)->getValue());
|
||||
self::assertEquals('some magic', $worksheet->getCellByColumnAndRow(11, 2)->getValue());
|
||||
self::assertEquals('is happening', $worksheet->getCellByColumnAndRow(12, 2)->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ class SpreadsheetExporterTest extends TestCase
|
||||
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
self::assertEquals('##test project##', $worksheet->getCellByColumnAndRow(1, 2, false)->getValue());
|
||||
self::assertEquals('~test project~', $worksheet->getCellByColumnAndRow(2, 2, false)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(3, 2, false)->getValue());
|
||||
self::assertEquals('##test project##', $worksheet->getCellByColumnAndRow(1, 2)->getValue());
|
||||
self::assertEquals('~test project~', $worksheet->getCellByColumnAndRow(2, 2)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(3, 2)->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,15 +46,15 @@ class UserExporterTest extends TestCase
|
||||
$spreadsheet = $sut->export([$user], new UserPreferenceDisplayEvent(UserPreferenceDisplayEvent::EXPORT));
|
||||
$worksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
self::assertNull($worksheet->getCellByColumnAndRow(1, 2, false)->getValue());
|
||||
self::assertEquals('test user', $worksheet->getCellByColumnAndRow(2, 2, false)->getValue());
|
||||
self::assertEquals('Another name', $worksheet->getCellByColumnAndRow(3, 2, false)->getValue());
|
||||
self::assertEquals('Mr. Title', $worksheet->getCellByColumnAndRow(4, 2, false)->getValue());
|
||||
self::assertEquals('test@example.com', $worksheet->getCellByColumnAndRow(5, 2, false)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(6, 2, false)->getValue());
|
||||
self::assertEquals('de', $worksheet->getCellByColumnAndRow(7, 2, false)->getValue());
|
||||
self::assertEquals('Europe/Berlin', $worksheet->getCellByColumnAndRow(8, 2, false)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2, false)->getValue());
|
||||
self::assertEquals('ROLE_TEAMLEAD;ROLE_USER', $worksheet->getCellByColumnAndRow(11, 2, false)->getValue());
|
||||
self::assertNull($worksheet->getCellByColumnAndRow(1, 2)->getValue());
|
||||
self::assertEquals('test user', $worksheet->getCellByColumnAndRow(2, 2)->getValue());
|
||||
self::assertEquals('Another name', $worksheet->getCellByColumnAndRow(3, 2)->getValue());
|
||||
self::assertEquals('Mr. Title', $worksheet->getCellByColumnAndRow(4, 2)->getValue());
|
||||
self::assertEquals('test@example.com', $worksheet->getCellByColumnAndRow(5, 2)->getValue());
|
||||
self::assertEquals('', $worksheet->getCellByColumnAndRow(6, 2)->getValue());
|
||||
self::assertEquals('de', $worksheet->getCellByColumnAndRow(7, 2)->getValue());
|
||||
self::assertEquals('Europe/Berlin', $worksheet->getCellByColumnAndRow(8, 2)->getValue());
|
||||
self::assertFalse($worksheet->getCellByColumnAndRow(9, 2)->getValue());
|
||||
self::assertEquals('ROLE_TEAMLEAD;ROLE_USER', $worksheet->getCellByColumnAndRow(11, 2)->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user