Skip to content

Commit

Permalink
Bump php version to 8.2 (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlakomski authored Oct 15, 2024
1 parent bf966ba commit 559b9d8
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 50 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
os:
- "ubuntu-22.04"
php-version:
- "8.1"
- "8.2"
- "8.3"
dependencies:
Expand Down Expand Up @@ -50,14 +49,14 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"

services:
postgres:
image: "postgres:16"
env:
POSTGRES_DB: "dqo"
POSTGRES_PASSWORD: "postgres"

options: >-
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"

Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ RUN apt-get update && \
zsh

RUN apt-add-repository -y ppa:ondrej/php && apt-get update && apt-get install -y --force-yes \
php8.1-cli \
php8.1-curl \
php8.1-intl \
php8.1-mysql \
php8.1-xml \
php8.1-mbstring \
php8.1-bcmath \
php8.1-zip \
php8.1-opcache \
php8.1-bz2 \
php8.1-gmp \
php8.1-sqlite \
php8.1-pgsql \
php8.1-xdebug \
php8.1-redis
php8.2-cli \
php8.2-curl \
php8.2-intl \
php8.2-mysql \
php8.2-xml \
php8.2-mbstring \
php8.2-bcmath \
php8.2-zip \
php8.2-opcache \
php8.2-bz2 \
php8.2-gmp \
php8.2-sqlite \
php8.2-pgsql \
php8.2-xdebug \
php8.2-redis

RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer
Expand Down
7 changes: 5 additions & 2 deletions ci/phpunit/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
verbose="true"
defaultTestSuite="unit">
verbose="true">

<testsuites>
<testsuite name="unit">
<directory>../../tests</directory>
<exclude>../../tests/Usage</exclude>
</testsuite>
<testsuite name="integration">
<directory>../../tests/Usage</directory>
<exclude>../../tests/Usage/symfony</exclude>
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=8.1",
"php": ">=8.2",
"doctrine/dbal": "^4.0",
"gowork/values": "^0.6",
"gowork/safe": "^0.2",
"symfony/console": "^6.0",
"symfony/dependency-injection": "^6.0",
"symfony/http-kernel": "^6.0",
"symfony/config": "^6.0",
"symfony/process": "^6.0",
"symfony/console": "^6.0|^7.0",
"symfony/dependency-injection": "^6.0|^7.0",
"symfony/http-kernel": "^6.0|^7.0",
"symfony/config": "^6.0|^7.0",
"symfony/process": "^6.0|^7.0",
"phpdocumentor/reflection-docblock": "^5.2",
"open-serializer/type": "^0.1",
"nikic/php-parser": "^4.10"
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/GenerateTablesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
use GW\DQO\Formatter\Formatter;
use GW\DQO\Generator\GenerateTables;
use GW\Safe\SafeConsoleInput;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand('dqo:generate-tables')]
final class GenerateTablesCommand extends Command
{
protected static $defaultName = 'dqo:generate-tables';
private GenerateTables $generateTables;
private Formatter $formatter;

Expand Down
10 changes: 6 additions & 4 deletions tests/SelectBuilder/DatabaseSelectBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ function test_select()
$builder = (new DatabaseSelectBuilder($this->conn()))
->from($messageTable)
->join($userTable, "{$messageTable->userId()} = {$userTable->id()}")
->select($userTable->name(), $messageTable->message());
->select($userTable->name(), $messageTable->message())
->orderBy($messageTable->id(), 'ASC');

$sql = $builder->getSQL();
$rows = $builder->fetchAll();

self::assertEquals(
'SELECT user.name as user_name, message.message as message_message FROM message INNER JOIN user user ON message.user_id = user.id',
'SELECT user.name as user_name, message.message as message_message FROM message INNER JOIN user user ON message.user_id = user.id ORDER BY message.id ASC',
$sql
);
self::assertCount(2, $rows);
Expand All @@ -93,12 +94,13 @@ function test_aliases()
$builder = (new DatabaseSelectBuilder($this->conn()))
->from($messageTable)
->join($userTable, "{$messageTable->userId()} = {$userTable->id()}")
->select($userTable->name(), $messageTable->message());
->select($userTable->name(), $messageTable->message())
->orderBy($messageTable->id(), 'ASC');

$sql = $builder->getSQL();
$rows = $builder->fetchAll();

self::assertEquals('SELECT u.name as u_name, m.message as m_message FROM message m INNER JOIN user u ON m.user_id = u.id', $sql);
self::assertEquals('SELECT u.name as u_name, m.message as m_message FROM message m INNER JOIN user u ON m.user_id = u.id ORDER BY m.id ASC', $sql);
self::assertCount(2, $rows);
self::assertEquals(
[
Expand Down
4 changes: 2 additions & 2 deletions tests/Usage/UsageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
$composerFile,
str_replace(
'"name": "gowork/dqo",',
'"name": "gowork/dqo", "version": "0.1", ',
'"name": "gowork/dqo", "version": "0.1.0", ',
self::$originalComposerContent
)
);
Expand All @@ -48,7 +48,7 @@ protected function tearDown(): void
);
}

function test_real_app()
public function test_real_app()
{
$env = [
'DATABASE_URL' => sprintf(
Expand Down
27 changes: 11 additions & 16 deletions tests/Usage/symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"type": "project",
"license": "proprietary",
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/orm": "^2.12",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/orm": "^3.2",
"gowork/dqo": "@dev",
"symfony/console": "6.1.*",
"symfony/dotenv": "6.1.*",
"symfony/http-kernel": "6.1.*",
"symfony/http-foundation": "6.1.*",
"symfony/framework-bundle": "6.1.*",
"symfony/yaml": "6.1.*",
"symfony/flex": "^1.3",
"symfony/console": "7.1.*",
"symfony/dotenv": "7.1.*",
"symfony/http-kernel": "7.1.*",
"symfony/http-foundation": "7.1.*",
"symfony/framework-bundle": "7.1.*",
"symfony/yaml": "7.1.*",
"symfony/flex": "^2",
"squizlabs/php_codesniffer": "3.*"
},
"repositories": [
Expand All @@ -41,11 +41,6 @@
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
Expand All @@ -58,7 +53,7 @@
"scripts": {
"archive-package": [
"mkdir -p repo",
"@composer archive --working-dir=../../../ --ignore-filters --dir=tests/Usage/symfony/repo --file=gowork-dqo-0.1 --format=zip"
"@composer archive --working-dir=../../../ --ignore-filters --dir=tests/Usage/symfony/repo --file=gowork-dqo-0.1.0 --format=zip"
],
"clear-files": [
"rm composer.lock symfony.lock || true",
Expand Down
2 changes: 1 addition & 1 deletion tests/Usage/symfony/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

0 comments on commit 559b9d8

Please sign in to comment.