Skip to content

Commit

Permalink
Fixed tests for Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 13, 2024
1 parent 449ecea commit 9d1f60b
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions tests/unit/gql/PrepareQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

use Craft;
use craft\db\Table;
use craft\elements\ElementCollection;
use craft\enums\PropagationMethod;
use craft\gql\resolvers\elements\Asset as AssetResolver;
use craft\gql\resolvers\elements\Category as CategoryResolver;
Expand Down Expand Up @@ -100,13 +99,13 @@ protected function _after(): void
Craft::$app->set('entries', new Entries());
}

public const VOLUME_UID = 'volume-uid';
public const CATEGORY_GROUP_UID = 'categoryGroup-uid';
public const SECTION_UID = 'section-uid';
public const ENTRY_TYPE_UID = 'entryType-uid';
public const GLOBAL_SET_UID = 'globalSet-uid';
public const TAG_GROUP_UID = 'tagGroup-uid';
public const USER_GROUP_UID = 'userGroup-uid';
public const VOLUME_UID = 'volume-uid--------------------------';
public const CATEGORY_GROUP_UID = 'categoryGroup-uid-------------------';
public const SECTION_UID = 'section-uid-------------------------';
public const ENTRY_TYPE_UID = 'entryType-uid-----------------------';
public const GLOBAL_SET_UID = 'globalSet-uid-----------------------';
public const TAG_GROUP_UID = 'tagGroup-uid------------------------';
public const USER_GROUP_UID = 'userGroup-uid-----------------------';

/**
* Test relational field query preparation
Expand Down Expand Up @@ -190,10 +189,6 @@ public function relationalFieldQueryPreparationProvider(): array
[
EntryResolver::class, [null, []], function($result) {
$section = Craft::$app->getEntries()->getSectionByUid(self::SECTION_UID);
// todo: figure out why $section is null during CI
if (!$section) {
return $result instanceof ElementCollection && $result->isEmpty();
}
return $result->where === ['or', ['in', 'entries.sectionId', [$section->id]]];
},
],
Expand Down

0 comments on commit 9d1f60b

Please sign in to comment.