Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ jobs:

strategy:
matrix:
php: [8.1, 8.2, 8.3, 8.4]
php: [8.2, 8.3, 8.4, 8.5]
composer_flags: [ '', '--prefer-lowest' ]

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo, sqlite
coverage: none
# this ini directive seems to be off by default in PHP 8.5
# see https://github.com/php/php-src/issues/20279
# enable it because codeception relies on it.
ini-values: register_argc_argv=1

- name: Validate composer.json and composer.lock
run: composer validate
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"homepage": "https://codeception.com/",
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"ext-pdo": "*",
"codeception/codeception": "^5.1"
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A Doctrine module for Codeception.

## Requirements

* `PHP 8.1` or higher.
* `PHP 8.2` or higher.

## Installation

Expand Down
34 changes: 34 additions & 0 deletions tests/data/doctrine_entities/EntityWithUlid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Symfony\Component\Uid\Ulid;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class EntityWithUlid
{
/**
* @ORM\Id
* @ORM\Column(type="ulid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator")
*/
#[ORM\Id]
#[ORM\Column(type: 'ulid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
private ?Ulid $id = null;

public function __construct()
{
$this->id = new Ulid();
}

public function getId(): Ulid
{
return $this->id;
}
}
34 changes: 0 additions & 34 deletions tests/data/doctrine_entities/EntityWithUuid.php

This file was deleted.

18 changes: 9 additions & 9 deletions tests/unit/Codeception/Module/Doctrine2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
use QuirkyFieldName\AssociationHost;
use QuirkyFieldName\Embeddable;
use QuirkyFieldName\EmbeddableHost;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
use Symfony\Bridge\Doctrine\Types\UlidType;
use Symfony\Component\Uid\Ulid;

final class DoctrineTest extends Unit
{
Expand All @@ -36,8 +36,8 @@ final class DoctrineTest extends Unit

protected static function _setUpBeforeClass()
{
if (!Type::hasType('uuid')) {
Type::addType('uuid', UuidType::class);
if (!Type::hasType('ulid')) {
Type::addType('ulid', UlidType::class);
}
}

Expand Down Expand Up @@ -69,7 +69,7 @@ protected function _setUp()
require_once $dir . "/CircularRelations/A.php";
require_once $dir . "/CircularRelations/B.php";
require_once $dir . "/CircularRelations/C.php";
require_once $dir . '/EntityWithUuid.php';
require_once $dir . '/EntityWithUlid.php';

$sqliteDriver = 'sqlite3';
// The driver "sqlite3" is only available as-of doctrine/dbal:3.5
Expand Down Expand Up @@ -111,7 +111,7 @@ protected function _setUp()
$this->em->getClassMetadata(\CircularRelations\A::class),
$this->em->getClassMetadata(\CircularRelations\B::class),
$this->em->getClassMetadata(\CircularRelations\C::class),
$this->em->getClassMetadata(EntityWithUuid::class),
$this->em->getClassMetadata(EntityWithUlid::class),
]);

$container = Stub::make(ModuleContainer::class);
Expand Down Expand Up @@ -435,13 +435,13 @@ public function testCompositePrimaryKeyWithEntities()

/**
* The purpose of this test is to verify that entites with object @id, that are
* not entites itself, e.g. Symfony\Component\Uid\Uuid, don't break the debug message.
* not entites itself, e.g. Symfony\Component\Uid\Ulid, don't break the debug message.
*/
public function testDebugEntityWithNonEntityButObjectId()
{
$pk = $this->module->haveInRepository(EntityWithUuid::class);
$pk = $this->module->haveInRepository(EntityWithUlid::class);

self::assertInstanceOf(Uuid::class, $pk);
self::assertInstanceOf(Ulid::class, $pk);
}

public function testRefresh()
Expand Down