Skip to content

Commit

Permalink
Merge pull request #18 from nextras/php8.3
Browse files Browse the repository at this point in the history
Build with Php 8.3
  • Loading branch information
hrach authored Dec 2, 2023
2 parents cbec8dc + b1d03fe commit bbe866d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
php-version: [ '7.2', '8.2' ]
php-version: [ '7.2', '8.1', '8.2', '8.3' ]

steps:
- name: Checkout
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '7.2', '8.0', '8.1', '8.2' ]
php-version: [ '7.2', '8.0', '8.1', '8.2', '8.3' ]

runs-on: ubuntu-latest

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
},
"require-dev": {
"nette/tester": "~2.0",
"phpstan/phpstan": "1.10.11",
"phpstan/extension-installer": "1.2.0",
"phpstan/phpstan-strict-rules": "1.5.1"
"phpstan/phpstan": "1.10.47",
"phpstan/extension-installer": "1.3.1",
"phpstan/phpstan-strict-rules": "1.5.2"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 8 additions & 10 deletions tests/cases/PostgreSqlMultiQueryParserTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ class PostgreSqlMultiQueryParserTest extends TestCase
$parser = new PostgreSqlMultiQueryParser();
$queries = iterator_to_array($parser->parseFile(__DIR__ . '/data/postgres.sql'));
Assert::count(66, $queries);
Assert::same(<<<SQL
CREATE FUNCTION "book_collections_before"() RETURNS TRIGGER AS
\$BODY$
BEGIN
NEW."updated_at" = NOW();
return NEW;
END;
\$BODY$
LANGUAGE 'plpgsql' VOLATILE
SQL, $queries[16]);
Assert::same("CREATE FUNCTION \"book_collections_before\"() RETURNS TRIGGER AS
\$BODY$
BEGIN
NEW.\"updated_at\" = NOW();
return NEW;
END;
\$BODY$
LANGUAGE 'plpgsql' VOLATILE", $queries[16]);
}
}

Expand Down
46 changes: 22 additions & 24 deletions tests/cases/SqlServerMultiQueryParserTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,28 @@ class SqlServerMultiQueryParserTest extends TestCase
$parser = new SqlServerMultiQueryParser();
$queries = iterator_to_array($parser->parseFile(__DIR__ . '/data/sqlserver.sql'));
Assert::count(69, $queries);
Assert::same(<<<SQL
CREATE TRIGGER mydatabase.trigger_book_stats
ON yourtable.books
AFTER INSERT, DELETE
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO yourtable.book_stats(
book_id,
string_value
)
SELECT
i.book_id,
'INS'
FROM
inserted i
UNION ALL
SELECT
d.book_id,
'DEL'
FROM
deleted d;
END
SQL, $queries[67]);
Assert::same("CREATE TRIGGER mydatabase.trigger_book_stats
ON yourtable.books
AFTER INSERT, DELETE
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO yourtable.book_stats(
book_id,
string_value
)
SELECT
i.book_id,
'INS'
FROM
inserted i
UNION ALL
SELECT
d.book_id,
'DEL'
FROM
deleted d;
END", $queries[67]);
}
}

Expand Down

0 comments on commit bbe866d

Please sign in to comment.