Verified Commit 8331ba7e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3402713 by mstrelan, smustgrave, dww: Fix strict type errors:...

Issue #3402713 by mstrelan, smustgrave, dww: Fix strict type errors: miscellaneous fixes in core Kernel tests

(cherry picked from commit f60bcea7)
parent e3da4cc3
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -513,7 +513,7 @@ public function testLineBreakFilterTwigDebug(): void {
      'children' => 'Test two',
    ];
    include_once $this->root . '/core/themes/engines/twig/twig.engine';
    $render = twig_render_template('container.html.twig', $variables);
    $render = (string) twig_render_template('container.html.twig', $variables);
    $render = trim($render);

    // Render text before applying the auto paragraph filter.
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ public function testLinkDeserialization() {
      ->set('query', $parsed_url['query']);
    $json = json_decode($this->serializer->serialize($entity, 'json'), TRUE);
    $json['field_test'][0]['options'] = 'string data';
    $serialized = json_encode($json, TRUE);
    $serialized = json_encode($json);
    $this->expectException(\LogicException::class);
    $this->expectExceptionMessage('The generic FieldItemNormalizer cannot denormalize string values for "options" properties of the "field_test" field (field item class: Drupal\link\Plugin\Field\FieldType\LinkItem).');
    $this->serializer->deserialize($serialized, EntityTest::class, 'json');
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ public function testTemporaryQuery() {

    // Assert that the table is indeed a temporary one.
    $temporary_table_info = $connection->query("SHOW CREATE TABLE {" . $table_name_test . "}")->fetchAssoc();
    $this->stringContains($temporary_table_info["Create Table"], "CREATE TEMPORARY TABLE");
    $this->assertStringContainsString('CREATE TEMPORARY TABLE', $temporary_table_info['Create Table']);

    // Assert that both have the same field names.
    $normal_table_fields = $connection->query("SELECT * FROM {test}")->fetch();
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public function testPathPlugin(): void {

    // Test with view_mode full.
    $output = $view->preview();
    $output = $renderer->renderRoot($output);
    $output = (string) $renderer->renderRoot($output);
    foreach ($this->nodes as $node) {
      $this->assertStringContainsString('This is <strong>not escaped</strong> and this is ' . $node->toLink('the link')->toString(), $output, 'Make sure path field rewriting is not escaped.');
    }
+2 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public function testRowPlugin(): void {

    // Test with view_mode full.
    $output = $view->preview();
    $output = $renderer->renderRoot($output);
    $output = (string) $renderer->renderRoot($output);
    foreach ($this->nodes as $node) {
      $this->assertStringNotContainsString($node->body->summary, $output, 'Make sure the teaser appears in the output of the view.');
      $this->assertStringContainsString($node->body->value, $output, 'Make sure the full text appears in the output of the view.');
@@ -107,7 +107,7 @@ public function testRowPlugin(): void {
    // Test with teasers.
    $view->rowPlugin->options['view_mode'] = 'teaser';
    $output = $view->preview();
    $output = $renderer->renderRoot($output);
    $output = (string) $renderer->renderRoot($output);
    foreach ($this->nodes as $node) {
      $this->assertStringContainsString($node->body->summary, $output, 'Make sure the teaser appears in the output of the view.');
      $this->assertStringNotContainsString($node->body->value, $output);
Loading