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
|
||||
* @package GraphQL\Type\Definition
|
||||
* @deprecated See https://github.com/webonyx/graphql-php/issues/148 for alternatives
|
||||
*/
|
||||
class Config
|
||||
{
|
||||
@ -43,7 +44,10 @@ class Config
|
||||
private static $allowCustomOptions = true;
|
||||
|
||||
/**
|
||||
*
|
||||
* Disables config validation
|
||||
*
|
||||
* @deprecated See https://github.com/webonyx/graphql-php/issues/148 for alternatives
|
||||
*/
|
||||
public static function disableValidation()
|
||||
{
|
||||
@ -53,6 +57,8 @@ class Config
|
||||
/**
|
||||
* Enable deep config validation (disabled by default because it creates significant performance overhead).
|
||||
* 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)
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
namespace GraphQL\Tests\Type;
|
||||
|
||||
use GraphQL\Error\InvariantViolation;
|
||||
use GraphQL\Error\Warning;
|
||||
use GraphQL\Type\Definition\Config;
|
||||
use GraphQL\Type\Definition\EnumType;
|
||||
use GraphQL\Type\Definition\InputObjectType;
|
||||
@ -14,12 +15,13 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
\PHPUnit_Framework_Error_Deprecated::$enabled = false;
|
||||
Warning::suppress(Warning::CONFIG_DEPRECATION_WARNING);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
Config::disableValidation();
|
||||
Warning::enable(Warning::CONFIG_DEPRECATION_WARNING);
|
||||
}
|
||||
|
||||
public function testToggling()
|
||||
|
Loading…
x
Reference in New Issue
Block a user