Skip to content

Commit 426b426

Browse files
committed
Ditch phpunit groups in favor of skipping tests
1 parent f717029 commit 426b426

File tree

7 files changed

+14
-19
lines changed

7 files changed

+14
-19
lines changed

.github/workflows/continuous-integration.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040

4141
- name: "Run PHPUnit"
4242
continue-on-error: true
43-
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml --exclude-group performance,locking_functional,dbal2"
43+
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml"
4444
env:
4545
ENABLE_SECOND_LEVEL_CACHE: 0
4646

4747
- name: "Run PHPUnit with Second Level Cache"
4848
id: "phpunit-run-slc"
4949
continue-on-error: true
50-
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional,dbal2 --coverage-clover=coverage-cache.xml"
50+
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml"
5151
env:
5252
ENABLE_SECOND_LEVEL_CACHE: 1
5353

@@ -93,7 +93,7 @@ jobs:
9393
ENABLE_SECOND_LEVEL_CACHE: 0
9494

9595
- name: "Run PHPUnit with Second Level Cache"
96-
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional,dbal3 --coverage-clover=coverage-cache.xml"
96+
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml"
9797
env:
9898
ENABLE_SECOND_LEVEL_CACHE: 1
9999

@@ -261,7 +261,7 @@ jobs:
261261
ENABLE_SECOND_LEVEL_CACHE: 0
262262

263263
- name: "Run PHPUnit with Second Level Cache"
264-
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --exclude-group performance,non-cacheable,locking_functional,dbal3 --coverage-clover=coverage-no-cache.xml"
264+
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-no-cache.xml"
265265
env:
266266
ENABLE_SECOND_LEVEL_CACHE: 1
267267

ci/github/phpunit/mysqli.xml

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<exclude>
3434
<group>performance</group>
3535
<group>locking_functional</group>
36-
<group>dbal3</group>
3736
</exclude>
3837
</groups>
3938
</phpunit>

ci/github/phpunit/pdo_mysql.xml

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<exclude>
3535
<group>performance</group>
3636
<group>locking_functional</group>
37-
<group>dbal3</group>
3837
</exclude>
3938
</groups>
4039
</phpunit>

ci/github/phpunit/pdo_pgsql.xml

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<exclude>
3434
<group>performance</group>
3535
<group>locking_functional</group>
36-
<group>dbal3</group>
3736
</exclude>
3837
</groups>
3938
</phpunit>

ci/github/phpunit/sqlite.xml

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<exclude>
3232
<group>performance</group>
3333
<group>locking_functional</group>
34-
<group>dbal3</group>
3534
</exclude>
3635
</groups>
3736
</phpunit>

phpunit.xml.dist

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<exclude>
2929
<group>performance</group>
3030
<group>locking_functional</group>
31-
<group>dbal3</group>
3231
</exclude>
3332
</groups>
3433

tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Doctrine\Tests\ORM\Functional;
66

77
use Doctrine\DBAL\Connection;
8+
use Doctrine\DBAL\Platforms\AbstractPlatform;
89
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
910
use Doctrine\ORM\Exception\NotSupported;
1011
use Doctrine\ORM\Mapping\Column;
@@ -23,25 +24,23 @@ class UUIDGeneratorTest extends OrmFunctionalTestCase
2324
{
2425
use VerifyDeprecations;
2526

26-
/**
27-
* @group dbal2
28-
*/
2927
public function testItIsDeprecated(): void
3028
{
29+
if (! method_exists(AbstractPlatform::class, 'getGuidExpression')) {
30+
self::markTestSkipped('Test valid for doctrine/dbal:2.x only.');
31+
}
32+
3133
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issues/7312');
3234
$this->_em->getClassMetadata(UUIDEntity::class);
3335
}
3436

35-
/**
36-
* @group dbal2
37-
*/
3837
public function testGenerateUUID(): void
3938
{
4039
if ($this->_em->getConnection()->getDatabasePlatform()->getName() !== 'mysql') {
4140
self::markTestSkipped('Currently restricted to MySQL platform.');
4241
}
4342

44-
if (! method_exists(Connection::class, 'getGuidExpression')) {
43+
if (! method_exists(AbstractPlatform::class, 'getGuidExpression')) {
4544
self::markTestSkipped('Test valid for doctrine/dbal:2.x only.');
4645
}
4746

@@ -55,11 +54,12 @@ public function testGenerateUUID(): void
5554
self::assertGreaterThan(0, strlen($entity->getId()));
5655
}
5756

58-
/**
59-
* @group dbal3
60-
*/
6157
public function testItCannotBeInitialised(): void
6258
{
59+
if (method_exists(AbstractPlatform::class, 'getGuidExpression')) {
60+
self::markTestSkipped('Test valid for doctrine/dbal:3.x only.');
61+
}
62+
6363
$this->expectException(NotSupported::class);
6464
$this->_em->getClassMetadata(UUIDEntity::class);
6565
}

0 commit comments

Comments
 (0)