GraphQL\Tests\Executor\DirectivesTest::testWorksOnScalars PHP Метод

testWorksOnScalars() публичный Метод

public testWorksOnScalars ( )
    public function testWorksOnScalars()
    {
        // if true includes scalar
        $this->assertEquals(['data' => ['a' => 'a', 'b' => 'b']], $this->executeTestQuery('{ a, b @include(if: true) }'));
        // if false omits on scalar
        $this->assertEquals(['data' => ['a' => 'a']], $this->executeTestQuery('{ a, b @include(if: false) }'));
        // unless false includes scalar
        $this->assertEquals(['data' => ['a' => 'a', 'b' => 'b']], $this->executeTestQuery('{ a, b @skip(if: false) }'));
        // unless true omits scalar
        $this->assertEquals(['data' => ['a' => 'a']], $this->executeTestQuery('{ a, b @skip(if: true) }'));
    }