Make compatible with mysql 8 strict modes

This commit is contained in:
Daniel Siepmann 2021-09-08 12:12:25 +02:00
parent dd0f08e157
commit def55cbdc9
6 changed files with 100 additions and 48 deletions

View file

@ -168,7 +168,7 @@ jobs:
- name: Code Quality (by PHPStan)
run: ./vendor/bin/phpstan analyse
tests:
tests-sqlite:
runs-on: ubuntu-latest
needs:
- check-dependencies
@ -206,3 +206,55 @@ jobs:
- name: PHPUnit Tests
run: ./vendor/bin/phpunit --testdox
tests-mysql-8:
runs-on: ubuntu-latest
needs:
- check-dependencies
- xml-linting
strategy:
matrix:
php-version:
- 7.3
- 7.4
steps:
- uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Use expected composer version
run: sudo composer selfupdate --2
- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql version: '5.7'
mysql database: 'typo3'
mysql root password: 'root'
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: PHPUnit Tests
run: |-
export typo3DatabaseDriver="pdo_mysql"
export typo3DatabaseName="typo3"
export typo3DatabaseHost="127.0.0.1"
export typo3DatabaseUsername="root"
export typo3DatabasePassword="root"
./vendor/bin/phpunit --testdox

View file

@ -5,7 +5,7 @@
<pid>3</pid>
<title>Attraktion mit false</title>
<description></description>
<town></town>
<town>0</town>
<media></media>
<opening_hours></opening_hours>
<address></address>
@ -28,7 +28,7 @@
<pid>3</pid>
<title>Attraktion mit true</title>
<description></description>
<town></town>
<town>0</town>
<media></media>
<opening_hours></opening_hours>
<address></address>

View file

@ -5,7 +5,7 @@
<pid>3</pid>
<title>Attraktion mit pets_allowed = false</title>
<description></description>
<town></town>
<town>0</town>
<media></media>
<opening_hours></opening_hours>
<address></address>
@ -27,7 +27,7 @@
<pid>3</pid>
<title>Attraktion mit pets_allowed = true</title>
<description></description>
<town></town>
<town>0</town>
<media></media>
<opening_hours></opening_hours>
<address></address>

View file

@ -5,7 +5,7 @@
<pid>3</pid>
<title>Attraktion mit public_access = false</title>
<description></description>
<town></town>
<town>0</town>
<media></media>
<opening_hours></opening_hours>
<address></address>
@ -27,7 +27,7 @@
<pid>3</pid>
<title>Attraktion mit public_access = true</title>
<description></description>
<town></town>
<town>0</town>
<media></media>
<opening_hours></opening_hours>
<address></address>

View file

@ -167,19 +167,19 @@ class ImportTest extends TestCase
self::assertCount(1, $organisations);
self::assertSame('https://thuecat.org/resources/018132452787-ngbe', $organisations[0]['remote_id']);
self::assertSame('Erfurt Tourismus und Marketing GmbH', $organisations[0]['title']);
self::assertSame('1', $organisations[0]['uid']);
self::assertSame(1, (int)$organisations[0]['uid']);
$importLogs = $this->getAllRecords('tx_thuecat_import_log');
self::assertCount(1, $importLogs);
self::assertSame('1', $importLogs[0]['configuration']);
self::assertSame('1', $importLogs[0]['uid']);
self::assertSame(1, (int)$importLogs[0]['configuration']);
self::assertSame(1, (int)$importLogs[0]['uid']);
$importLogEntries = $this->getAllRecords('tx_thuecat_import_log_entry');
self::assertCount(1, $importLogEntries);
self::assertSame('1', $importLogEntries[0]['import_log']);
self::assertSame('1', $importLogEntries[0]['record_uid']);
self::assertSame(1, (int)$importLogEntries[0]['import_log']);
self::assertSame(1, (int)$importLogEntries[0]['record_uid']);
self::assertSame('tx_thuecat_organisation', $importLogEntries[0]['table_name']);
self::assertSame('0', $importLogEntries[0]['insertion']);
self::assertSame(0, (int)$importLogEntries[0]['insertion']);
self::assertSame('[]', $importLogEntries[0]['errors']);
}

View file

@ -18,13 +18,13 @@ CREATE TABLE tx_thuecat_import_log_entry (
record_uid int(11) unsigned DEFAULT '0' NOT NULL,
table_name varchar(255) DEFAULT '' NOT NULL,
insertion TINYINT(1) unsigned DEFAULT '0' NOT NULL,
errors text DEFAULT '' NOT NULL,
errors text,
);
CREATE TABLE tx_thuecat_organisation (
remote_id varchar(255) DEFAULT '' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL,
description text,
manages_towns int(11) unsigned DEFAULT '0' NOT NULL,
manages_tourist_information int(11) unsigned DEFAULT '0' NOT NULL,
manages_tourist_attraction int(11) unsigned DEFAULT '0' NOT NULL,
@ -35,7 +35,7 @@ CREATE TABLE tx_thuecat_town (
managed_by int(11) unsigned DEFAULT '0' NOT NULL,
tourist_information int(11) unsigned DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL,
description text,
);
CREATE TABLE tx_thuecat_tourist_information (
@ -43,7 +43,7 @@ CREATE TABLE tx_thuecat_tourist_information (
managed_by int(11) unsigned DEFAULT '0' NOT NULL,
town int(11) unsigned DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL,
description text,
);
CREATE TABLE tx_thuecat_tourist_attraction (
@ -52,27 +52,27 @@ CREATE TABLE tx_thuecat_tourist_attraction (
town int(11) unsigned DEFAULT '0' NOT NULL,
parking_facility_near_by varchar(255) DEFAULT '' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL,
opening_hours text DEFAULT '' NOT NULL,
address text DEFAULT '' NOT NULL,
media text DEFAULT '' NOT NULL,
offers text DEFAULT '' NOT NULL,
slogan text DEFAULT '' NOT NULL,
start_of_construction text DEFAULT '' NOT NULL,
sanitation text DEFAULT '' NOT NULL,
other_service text DEFAULT '' NOT NULL,
museum_service text DEFAULT '' NOT NULL,
architectural_style text DEFAULT '' NOT NULL,
traffic_infrastructure text DEFAULT '' NOT NULL,
payment_accepted text DEFAULT '' NOT NULL,
digital_offer text DEFAULT '' NOT NULL,
photography text DEFAULT '' NOT NULL,
pets_allowed text DEFAULT '' NOT NULL,
is_accessible_for_free text DEFAULT '' NOT NULL,
public_access text DEFAULT '' NOT NULL,
available_languages text DEFAULT '' NOT NULL,
distance_to_public_transport text DEFAULT '' NOT NULL,
accessibility_specification text DEFAULT '' NOT NULL,
description text,
opening_hours text,
address text,
media text,
offers text,
slogan text,
start_of_construction text,
sanitation text,
other_service text,
museum_service text,
architectural_style text,
traffic_infrastructure text,
payment_accepted text,
digital_offer text,
photography text,
pets_allowed text,
is_accessible_for_free text,
public_access text,
available_languages text,
distance_to_public_transport text,
accessibility_specification text,
);
CREATE TABLE tx_thuecat_parking_facility (
@ -80,14 +80,14 @@ CREATE TABLE tx_thuecat_parking_facility (
managed_by int(11) unsigned DEFAULT '0' NOT NULL,
town int(11) unsigned DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
description text DEFAULT '' NOT NULL,
opening_hours text DEFAULT '' NOT NULL,
address text DEFAULT '' NOT NULL,
media text DEFAULT '' NOT NULL,
offers text DEFAULT '' NOT NULL,
sanitation text DEFAULT '' NOT NULL,
other_service text DEFAULT '' NOT NULL,
traffic_infrastructure text DEFAULT '' NOT NULL,
payment_accepted text DEFAULT '' NOT NULL,
distance_to_public_transport text DEFAULT '' NOT NULL,
description text,
opening_hours text,
address text,
media text,
offers text,
sanitation text,
other_service text,
traffic_infrastructure text,
payment_accepted text,
distance_to_public_transport text,
);