mirror of
https://github.com/werkraum-media/thuecat.git
synced 2024-09-28 19:26:11 +02:00
Make compatible with mysql 8 strict modes
This commit is contained in:
parent
dd0f08e157
commit
def55cbdc9
6 changed files with 100 additions and 48 deletions
54
.github/workflows/ci.yaml
vendored
54
.github/workflows/ci.yaml
vendored
|
@ -168,7 +168,7 @@ jobs:
|
||||||
- name: Code Quality (by PHPStan)
|
- name: Code Quality (by PHPStan)
|
||||||
run: ./vendor/bin/phpstan analyse
|
run: ./vendor/bin/phpstan analyse
|
||||||
|
|
||||||
tests:
|
tests-sqlite:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- check-dependencies
|
- check-dependencies
|
||||||
|
@ -206,3 +206,55 @@ jobs:
|
||||||
|
|
||||||
- name: PHPUnit Tests
|
- name: PHPUnit Tests
|
||||||
run: ./vendor/bin/phpunit --testdox
|
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
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<pid>3</pid>
|
<pid>3</pid>
|
||||||
<title>Attraktion mit false</title>
|
<title>Attraktion mit false</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
<town></town>
|
<town>0</town>
|
||||||
<media></media>
|
<media></media>
|
||||||
<opening_hours></opening_hours>
|
<opening_hours></opening_hours>
|
||||||
<address></address>
|
<address></address>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<pid>3</pid>
|
<pid>3</pid>
|
||||||
<title>Attraktion mit true</title>
|
<title>Attraktion mit true</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
<town></town>
|
<town>0</town>
|
||||||
<media></media>
|
<media></media>
|
||||||
<opening_hours></opening_hours>
|
<opening_hours></opening_hours>
|
||||||
<address></address>
|
<address></address>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<pid>3</pid>
|
<pid>3</pid>
|
||||||
<title>Attraktion mit pets_allowed = false</title>
|
<title>Attraktion mit pets_allowed = false</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
<town></town>
|
<town>0</town>
|
||||||
<media></media>
|
<media></media>
|
||||||
<opening_hours></opening_hours>
|
<opening_hours></opening_hours>
|
||||||
<address></address>
|
<address></address>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<pid>3</pid>
|
<pid>3</pid>
|
||||||
<title>Attraktion mit pets_allowed = true</title>
|
<title>Attraktion mit pets_allowed = true</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
<town></town>
|
<town>0</town>
|
||||||
<media></media>
|
<media></media>
|
||||||
<opening_hours></opening_hours>
|
<opening_hours></opening_hours>
|
||||||
<address></address>
|
<address></address>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<pid>3</pid>
|
<pid>3</pid>
|
||||||
<title>Attraktion mit public_access = false</title>
|
<title>Attraktion mit public_access = false</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
<town></town>
|
<town>0</town>
|
||||||
<media></media>
|
<media></media>
|
||||||
<opening_hours></opening_hours>
|
<opening_hours></opening_hours>
|
||||||
<address></address>
|
<address></address>
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<pid>3</pid>
|
<pid>3</pid>
|
||||||
<title>Attraktion mit public_access = true</title>
|
<title>Attraktion mit public_access = true</title>
|
||||||
<description></description>
|
<description></description>
|
||||||
<town></town>
|
<town>0</town>
|
||||||
<media></media>
|
<media></media>
|
||||||
<opening_hours></opening_hours>
|
<opening_hours></opening_hours>
|
||||||
<address></address>
|
<address></address>
|
||||||
|
|
|
@ -167,19 +167,19 @@ class ImportTest extends TestCase
|
||||||
self::assertCount(1, $organisations);
|
self::assertCount(1, $organisations);
|
||||||
self::assertSame('https://thuecat.org/resources/018132452787-ngbe', $organisations[0]['remote_id']);
|
self::assertSame('https://thuecat.org/resources/018132452787-ngbe', $organisations[0]['remote_id']);
|
||||||
self::assertSame('Erfurt Tourismus und Marketing GmbH', $organisations[0]['title']);
|
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');
|
$importLogs = $this->getAllRecords('tx_thuecat_import_log');
|
||||||
self::assertCount(1, $importLogs);
|
self::assertCount(1, $importLogs);
|
||||||
self::assertSame('1', $importLogs[0]['configuration']);
|
self::assertSame(1, (int)$importLogs[0]['configuration']);
|
||||||
self::assertSame('1', $importLogs[0]['uid']);
|
self::assertSame(1, (int)$importLogs[0]['uid']);
|
||||||
|
|
||||||
$importLogEntries = $this->getAllRecords('tx_thuecat_import_log_entry');
|
$importLogEntries = $this->getAllRecords('tx_thuecat_import_log_entry');
|
||||||
self::assertCount(1, $importLogEntries);
|
self::assertCount(1, $importLogEntries);
|
||||||
self::assertSame('1', $importLogEntries[0]['import_log']);
|
self::assertSame(1, (int)$importLogEntries[0]['import_log']);
|
||||||
self::assertSame('1', $importLogEntries[0]['record_uid']);
|
self::assertSame(1, (int)$importLogEntries[0]['record_uid']);
|
||||||
self::assertSame('tx_thuecat_organisation', $importLogEntries[0]['table_name']);
|
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']);
|
self::assertSame('[]', $importLogEntries[0]['errors']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,13 @@ CREATE TABLE tx_thuecat_import_log_entry (
|
||||||
record_uid int(11) unsigned DEFAULT '0' NOT NULL,
|
record_uid int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
table_name varchar(255) DEFAULT '' NOT NULL,
|
table_name varchar(255) DEFAULT '' NOT NULL,
|
||||||
insertion TINYINT(1) unsigned DEFAULT '0' NOT NULL,
|
insertion TINYINT(1) unsigned DEFAULT '0' NOT NULL,
|
||||||
errors text DEFAULT '' NOT NULL,
|
errors text,
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE tx_thuecat_organisation (
|
CREATE TABLE tx_thuecat_organisation (
|
||||||
remote_id varchar(255) DEFAULT '' NOT NULL,
|
remote_id varchar(255) DEFAULT '' NOT NULL,
|
||||||
title 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_towns int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
manages_tourist_information 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,
|
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,
|
managed_by int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
tourist_information int(11) unsigned DEFAULT '0' NOT NULL,
|
tourist_information int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
title varchar(255) DEFAULT '' NOT NULL,
|
title varchar(255) DEFAULT '' NOT NULL,
|
||||||
description text DEFAULT '' NOT NULL,
|
description text,
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE tx_thuecat_tourist_information (
|
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,
|
managed_by int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
town int(11) unsigned DEFAULT '0' NOT NULL,
|
town int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
title varchar(255) DEFAULT '' NOT NULL,
|
title varchar(255) DEFAULT '' NOT NULL,
|
||||||
description text DEFAULT '' NOT NULL,
|
description text,
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE tx_thuecat_tourist_attraction (
|
CREATE TABLE tx_thuecat_tourist_attraction (
|
||||||
|
@ -52,27 +52,27 @@ CREATE TABLE tx_thuecat_tourist_attraction (
|
||||||
town int(11) unsigned DEFAULT '0' NOT NULL,
|
town int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
parking_facility_near_by varchar(255) DEFAULT '' NOT NULL,
|
parking_facility_near_by varchar(255) DEFAULT '' NOT NULL,
|
||||||
title varchar(255) DEFAULT '' NOT NULL,
|
title varchar(255) DEFAULT '' NOT NULL,
|
||||||
description text DEFAULT '' NOT NULL,
|
description text,
|
||||||
opening_hours text DEFAULT '' NOT NULL,
|
opening_hours text,
|
||||||
address text DEFAULT '' NOT NULL,
|
address text,
|
||||||
media text DEFAULT '' NOT NULL,
|
media text,
|
||||||
offers text DEFAULT '' NOT NULL,
|
offers text,
|
||||||
slogan text DEFAULT '' NOT NULL,
|
slogan text,
|
||||||
start_of_construction text DEFAULT '' NOT NULL,
|
start_of_construction text,
|
||||||
sanitation text DEFAULT '' NOT NULL,
|
sanitation text,
|
||||||
other_service text DEFAULT '' NOT NULL,
|
other_service text,
|
||||||
museum_service text DEFAULT '' NOT NULL,
|
museum_service text,
|
||||||
architectural_style text DEFAULT '' NOT NULL,
|
architectural_style text,
|
||||||
traffic_infrastructure text DEFAULT '' NOT NULL,
|
traffic_infrastructure text,
|
||||||
payment_accepted text DEFAULT '' NOT NULL,
|
payment_accepted text,
|
||||||
digital_offer text DEFAULT '' NOT NULL,
|
digital_offer text,
|
||||||
photography text DEFAULT '' NOT NULL,
|
photography text,
|
||||||
pets_allowed text DEFAULT '' NOT NULL,
|
pets_allowed text,
|
||||||
is_accessible_for_free text DEFAULT '' NOT NULL,
|
is_accessible_for_free text,
|
||||||
public_access text DEFAULT '' NOT NULL,
|
public_access text,
|
||||||
available_languages text DEFAULT '' NOT NULL,
|
available_languages text,
|
||||||
distance_to_public_transport text DEFAULT '' NOT NULL,
|
distance_to_public_transport text,
|
||||||
accessibility_specification text DEFAULT '' NOT NULL,
|
accessibility_specification text,
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE tx_thuecat_parking_facility (
|
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,
|
managed_by int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
town int(11) unsigned DEFAULT '0' NOT NULL,
|
town int(11) unsigned DEFAULT '0' NOT NULL,
|
||||||
title varchar(255) DEFAULT '' NOT NULL,
|
title varchar(255) DEFAULT '' NOT NULL,
|
||||||
description text DEFAULT '' NOT NULL,
|
description text,
|
||||||
opening_hours text DEFAULT '' NOT NULL,
|
opening_hours text,
|
||||||
address text DEFAULT '' NOT NULL,
|
address text,
|
||||||
media text DEFAULT '' NOT NULL,
|
media text,
|
||||||
offers text DEFAULT '' NOT NULL,
|
offers text,
|
||||||
sanitation text DEFAULT '' NOT NULL,
|
sanitation text,
|
||||||
other_service text DEFAULT '' NOT NULL,
|
other_service text,
|
||||||
traffic_infrastructure text DEFAULT '' NOT NULL,
|
traffic_infrastructure text,
|
||||||
payment_accepted text DEFAULT '' NOT NULL,
|
payment_accepted text,
|
||||||
distance_to_public_transport text DEFAULT '' NOT NULL,
|
distance_to_public_transport text,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue