6 declare(strict_types=1);
29 private $graphQlController;
32 private $objectManager;
35 private $jsonSerializer;
37 protected function setUp()
41 $cache = $this->objectManager->get(Cache::class);
43 $fileResolverMock = $this->getMockBuilder(
45 )->disableOriginalConstructor()->getMock();
50 $fileResolverMock->expects($this->any())->method(
'get')->will($this->returnValue(
$fileList));
51 $graphQlReader = $this->objectManager->create(
52 \
Magento\Framework\GraphQlSchemaStitching\GraphQlReader::class,
53 [
'fileResolver' => $fileResolverMock]
55 $reader = $this->objectManager->create(
56 \
Magento\Framework\GraphQlSchemaStitching\Reader::class,
57 [
'readers' => [
'graphql_reader' => $graphQlReader]]
59 $data = $this->objectManager->create(
63 $this->configModel = $this->objectManager->create(
64 \
Magento\Framework\GraphQl\Config::class,
67 $outputMapper = $this->objectManager->create(
68 \
Magento\Framework\GraphQl\
Schema\Type\Output\OutputMapper::class,
69 [
'config' => $this->configModel]
71 $schemaGenerator = $this->objectManager->create(
72 SchemaGenerator::class,
73 [
'outputMapper' => $outputMapper]
75 $this->graphQlController = $this->objectManager->create(
77 [
'schemaGenerator' => $schemaGenerator]
79 $this->jsonSerializer = $this->objectManager->get(SerializerInterface::class);
85 public function testDispatchIntrospectionWithCustomSDL()
89 query IntrospectionQuery {
98 fragment FullType
on __Type {
102 fields(includeDeprecated:
true) {
120 enumValues(includeDeprecated:
true) {
130 fragment InputValue
on __InputValue {
137 fragment TypeRef
on __Type {
175 'operationName' =>
'IntrospectionQuery' 181 $headers = $this->objectManager->create(\
Zend\
Http\Headers::class)
182 ->addHeaders([
'Content-Type' =>
'application/json']);
186 $expectedOutput = require
__DIR__ .
'/../_files/schema_response_sdl_description.php';
188 $schemaResponseFields =
$output[
'data'][
'__schema'][
'types'];
189 $schemaResponseFieldsFirstHalf = array_slice($schemaResponseFields, 0, 25);
190 $schemaResponseFieldsSecondHalf = array_slice($schemaResponseFields, -21, 21);
191 $mergedSchemaResponseFields = array_merge($schemaResponseFieldsFirstHalf, $schemaResponseFieldsSecondHalf);
193 foreach ($expectedOutput as $searchTerm) {
195 (in_array($searchTerm, $mergedSchemaResponseFields)),
196 'Missing type in the response' 203 'Comment for empty PhysicalProductInterface',
204 array_column($expectedOutput,
'description')
212 'Comment for empty Enum',
213 array_column($expectedOutput,
'description')
221 'Comment for SearchResultPageInfo',
222 array_column($expectedOutput,
'description')
defined('TESTS_BP')||define('TESTS_BP' __DIR__
taxRateField this edit on("click.mselect-delete", ".mselect-delete", function() { if(!confirm('<?=/*@escapeNotVerified */__( 'Do you really want to delete this tax rate?') ?>')) { return;} var that=$(this), select=that.closest('.mselect-list').prev(), rateValue=that.parent().find( 'input[type="checkbox"]').val();$( 'body').trigger( 'processStart');var ajaxOptions={ type:'POST', data:{ tax_calculation_rate_id:rateValue, form_key:$( 'input[name="form_key"]').val() }, dataType:'json', url:'<?=/*@escapeNotVerified */$block->getTaxRateDeleteUrl() ?>', success:function(result, status) { $( 'body').trigger( 'processStop');if(result.success) { that.parent().remove();select.find( 'option').each(function() { if(this.value===rateValue) { $(this).remove();} });select.trigger( 'change.hiddenSelect');} else { if(result.error_message) alert({ content:result.error_message });else alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} }, error:function() { $( 'body').trigger( 'processStop');alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} };$.ajax(ajaxOptions);}) .on( 'click.mselectAdd'
static getObjectManager()