function ViewExecutableTest::testTamperedSerializationData

Same name and namespace in other branches
  1. main core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testTamperedSerializationData()

Tests that tampered serializationData keys throw an exception.

File

core/modules/views/tests/src/Kernel/ViewExecutableTest.php, line 568

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\Tests\views\Kernel

Code

public function testTamperedSerializationData() : void {
  $this->expectException(\RuntimeException::class);
  $this->expectExceptionMessage('Unexpected keys in Drupal\\views\\ViewExecutable::$serializationData.');
  unserialize('O:27:"Drupal\\views\\ViewExecutable":1:{s:17:"serializationData";a:1:{s:9:"malicious";s:4:"test";}}');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.