Skip to content

Commit d30ca90

Browse files
committed
Fix Consent entity and integration test
Entity fix: - Make 'attribute' column nullable: true so doctrine:schema:create generates a nullable column. CI uses schema:create, not migrations. storeConsentHash only sets attribute_stable, not attribute, causing SQLSTATE 1364 without this fix. Test fix: - Rename class EngineBlock_Corto_Model_Consent_Integration_Test to ConsentIntegrationTest to match filename (PHPUnit warning) - Make consentTypeProvider() static (PHPUnit deprecation)
1 parent 1d88d30 commit d30ca90

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/OpenConext/EngineBlockBundle/Authentication/Entity/Consent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Consent
5555
/**
5656
* @var string
5757
*/
58-
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80)]
58+
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 80, nullable: true)]
5959
public ?string $attribute = null;
6060

6161
/**

tests/library/EngineBlock/Test/Corto/Model/ConsentIntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use OpenConext\EngineBlockBundle\Authentication\Repository\DbalConsentRepository;
2727
use PHPUnit\Framework\TestCase;
2828

29-
class EngineBlock_Corto_Model_Consent_Integration_Test extends TestCase
29+
class ConsentIntegrationTest extends TestCase
3030
{
3131
use MockeryPHPUnitIntegration;
3232

@@ -235,7 +235,7 @@ public function test_upgrade_to_stable_consent_not_applied_when_stable($consentT
235235
$this->assertNull($this->consent->upgradeAttributeHashFor($serviceProvider, $consentType));
236236
}
237237

238-
public function consentTypeProvider()
238+
public static function consentTypeProvider(): iterable
239239
{
240240
yield [ConsentType::TYPE_IMPLICIT];
241241
yield [ConsentType::TYPE_EXPLICIT];

0 commit comments

Comments
 (0)