assertNormalizationEdgeCases example

'value' => '2017-03-01T20:02:00+00:00',
          'end_value' => '2017-03-01T20:02:00+00:00',
        ],
      ],
    ];
  }

  /** * {@inheritdoc} */
  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {
    parent::assertNormalizationEdgeCases($method$url$request_options);

    if ($this->entity->getEntityType()->hasKey('bundle')) {
      $fieldName = static::$fieldName;

      // DX: 422 when 'value' data type is incorrect.       $normalization = $this->getNormalizedPostEntity();
      $normalization[static::$fieldName][0]['value'] = [
        '2017', '03', '01', '21', '53', '00',
      ];
      $request_options[RequestOptions::BODY] = $this->serializer->encode($normalizationstatic::$format);
      $response = $this->request($method$url$request_options);
      

          'value' => static::$dateString,
        ],
      ],
    ];
  }

  /** * {@inheritdoc} */
  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {
    parent::assertNormalizationEdgeCases($method$url$request_options);

    if ($this->entity->getEntityType()->hasKey('bundle')) {
      $fieldName = static::$fieldName;

      // DX: 422 when date type is incorrect.       $normalization = $this->getNormalizedPostEntity();
      $normalization[static::$fieldName][0]['value'] = [
        '2017', '03', '01',
      ];

      $request_options[RequestOptions::BODY] = $this->serializer->encode($normalizationstatic::$format);
      

          'value' => static::$dateString . '+00:00',
        ],
      ],
    ];
  }

  /** * {@inheritdoc} */
  protected function assertNormalizationEdgeCases($method, Url $url, array $request_options): void {
    parent::assertNormalizationEdgeCases($method$url$request_options);

    if ($this->entity->getEntityType()->hasKey('bundle')) {
      $fieldName = static::$fieldName;

      // DX: 422 when date type is incorrect.       $normalization = $this->getNormalizedPostEntity();
      $normalization[static::$fieldName][0]['value'] = [
        '2017', '03', '01', '21', '53', '00',
      ];

      $request_options[RequestOptions::BODY] = $this->serializer->encode($normalizationstatic::$format);
      
$request_options[RequestOptions::BODY] = $parseable_invalid_request_body_3;

    // DX: 403 when entity contains field without 'edit' access.     $response = $this->request('POST', $url$request_options);
    $this->assertResourceErrorResponse(403, "Access denied on creating field 'field_rest_test'.", $response);

    $request_options[RequestOptions::BODY] = $parseable_valid_request_body;

    // Before sending a well-formed request, allow the normalization and     // authentication provider edge cases to also be tested.     $this->assertNormalizationEdgeCases('POST', $url$request_options);
    $this->assertAuthenticationEdgeCases('POST', $url$request_options);

    $request_options[RequestOptions::HEADERS]['Content-Type'] = 'text/xml';

    // DX: 415 when request body in existing but not allowed format.     $response = $this->request('POST', $url$request_options);
    $this->assertResourceErrorResponse(415, 'No route found that matches "Content-Type: text/xml"', $response);

    $request_options[RequestOptions::HEADERS]['Content-Type'] = static::$mimeType;

    // 201 for well-formed request.
Home | Imprint | This part of the site doesn't use cookies.