mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-24 22:06:04 +03:00
5cbaf973e1
Closes #219
17 lines
454 B
PHP
17 lines
454 B
PHP
<?php
|
|
namespace GraphQL\Tests;
|
|
|
|
use GraphQL\Utils\Utils;
|
|
|
|
class UtilsTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testAssignThrowsExceptionOnMissingRequiredKey()
|
|
{
|
|
$object = new \stdClass();
|
|
$object->requiredKey = 'value';
|
|
|
|
$this->setExpectedException(\InvalidArgumentException::class, 'Key requiredKey is expected to be set and not to be null');
|
|
Utils::assign($object, [], ['requiredKey']);
|
|
}
|
|
}
|