Skip to content

Commit 6cd877c

Browse files
committed
tests: ensure no graphql_debug() messages when correctly implementing interfaces
1 parent 31003b0 commit 6cd877c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/wpunit/InterfaceTest.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,13 @@ public function testArgsOnInterfaceFieldAreAppliedToObjectField() {
530530
interfaceArgsTest {
531531
fieldWithArgs
532532
}
533-
interfaceArgsTest2 {
534-
fieldWithArgs
535-
}
533+
interfaceArgsTest2 {
534+
fieldWithArgs
535+
}
536536
}';
537537

538538
$actual = $this->graphql( [ 'query' => $query ] );
539+
$this->assertEmpty( $actual['extensions']['debug'], 'The interface should be implemented with no debug messages.' );
539540
$expected = [
540541
$this->expectedField( 'interfaceArgsTest.fieldWithArgs', 'interfaceArg objectArg' ),
541542
$this->expectedField( 'interfaceArgsTest2.fieldWithArgs', 'interfaceArg' ),
@@ -697,8 +698,11 @@ public function testInterfaceWithNonNullableArg() {
697698

698699
$actual = $this->graphql( [ 'query' => $query ] );
699700

700-
$this->assertQuerySuccessful( $actual, [
701-
$this->expectedField( 'testField.fieldWithNonNullableArg', self::IS_NULL ),
702-
], 'The query should be valid as the list of and non null arguments defined on the interface are valid when querying the field that returns the object type' );
701+
$this->assertEmpty( $actual['extensions']['debug'], 'The interface should be implemented with no debug messages.' );
702+
$this->assertQuerySuccessful(
703+
$actual,
704+
[ $this->expectedField( 'testField.fieldWithNonNullableArg',self::IS_NULL ) ],
705+
'The query should be valid as the list of and non null arguments defined on the interface are valid when querying the field that returns the object type'
706+
);
703707
}
704708
}

0 commit comments

Comments
 (0)