Skip to content

Commit

Permalink
Update graphql-doctrine
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Nov 11, 2022
1 parent 60be93f commit 7a2a740
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Service/AbstractDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ final public static function loadData(string $dumpFile): void

private static function getDatabaseName(): string
{
/** @var array<string,int|string> $dbConfig */
/** @var array<string,string> $dbConfig */
$dbConfig = _em()->getConnection()->getParams();

return $dbConfig['dbname'];
Expand Down
11 changes: 6 additions & 5 deletions tests/UtilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,27 @@ public function testGetShortClassName(): void

public function testEntityIdToModel(): void
{
$fakeEntity = new stdClass();
$input = [
3 => new stdClass(),
4 => 1,
'model' => new User(),
'entity' => new class() extends EntityID {
public function __construct()
'entity' => new class($fakeEntity) extends EntityID {
public function __construct(private readonly object $fakeEntity)
{
}

public function getEntity(): string
public function getEntity(): object
{
return 'real entity';
return $this->fakeEntity;
}
},
];

$actual = Utility::entityIdToModel($input);

$expected = $input;
$expected['entity'] = 'real entity';
$expected['entity'] = $fakeEntity;

self::assertSame($expected, $actual, 'keys and non model values should be preserved');
self::assertNull(Utility::entityIdToModel(null));
Expand Down

0 comments on commit 7a2a740

Please # to comment.