mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 07:49:24 +03:00
Suppressing Config deprecation warning in tests
This commit is contained in:
parent
637156fe65
commit
9499e5ae8e
@ -8,6 +8,7 @@ use GraphQL\Utils\Utils;
|
|||||||
/**
|
/**
|
||||||
* Class Config
|
* Class Config
|
||||||
* @package GraphQL\Type\Definition
|
* @package GraphQL\Type\Definition
|
||||||
|
* @deprecated See https://github.com/webonyx/graphql-php/issues/148 for alternatives
|
||||||
*/
|
*/
|
||||||
class Config
|
class Config
|
||||||
{
|
{
|
||||||
@ -43,7 +44,10 @@ class Config
|
|||||||
private static $allowCustomOptions = true;
|
private static $allowCustomOptions = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* Disables config validation
|
* Disables config validation
|
||||||
|
*
|
||||||
|
* @deprecated See https://github.com/webonyx/graphql-php/issues/148 for alternatives
|
||||||
*/
|
*/
|
||||||
public static function disableValidation()
|
public static function disableValidation()
|
||||||
{
|
{
|
||||||
@ -53,6 +57,8 @@ class Config
|
|||||||
/**
|
/**
|
||||||
* Enable deep config validation (disabled by default because it creates significant performance overhead).
|
* Enable deep config validation (disabled by default because it creates significant performance overhead).
|
||||||
* Useful only at development to catch type definition errors quickly.
|
* Useful only at development to catch type definition errors quickly.
|
||||||
|
*
|
||||||
|
* @deprecated See https://github.com/webonyx/graphql-php/issues/148 for alternatives
|
||||||
*/
|
*/
|
||||||
public static function enableValidation($allowCustomOptions = true)
|
public static function enableValidation($allowCustomOptions = true)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
namespace GraphQL\Tests\Type;
|
namespace GraphQL\Tests\Type;
|
||||||
|
|
||||||
use GraphQL\Error\InvariantViolation;
|
use GraphQL\Error\InvariantViolation;
|
||||||
|
use GraphQL\Error\Warning;
|
||||||
use GraphQL\Type\Definition\Config;
|
use GraphQL\Type\Definition\Config;
|
||||||
use GraphQL\Type\Definition\EnumType;
|
use GraphQL\Type\Definition\EnumType;
|
||||||
use GraphQL\Type\Definition\InputObjectType;
|
use GraphQL\Type\Definition\InputObjectType;
|
||||||
@ -14,12 +15,13 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
\PHPUnit_Framework_Error_Deprecated::$enabled = false;
|
Warning::suppress(Warning::CONFIG_DEPRECATION_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
Config::disableValidation();
|
Config::disableValidation();
|
||||||
|
Warning::enable(Warning::CONFIG_DEPRECATION_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testToggling()
|
public function testToggling()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user