function ViewExecutableTest::testTamperedDeserializationT

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

Tests that tampered serialized ViewExecutable data throws an exception.

File

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

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\Tests\views\Kernel

Code

public function testTamperedDeserializationT() : void {
  $this->expectException(\RuntimeException::class);
  $this->expectExceptionMessage('Deserialization of Drupal\\views\\ViewExecutable::$built is not allowed.');
  unserialize('O:27:"Drupal\\views\\ViewExecutable":2:{s:5:"built";b:1;s:5:"pager";i:1;}');
}

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