function FormatPluralUpdateTest::testViewsFieldFormatPluralConversion
Tests that fields with the format_plural option are updated properly.
File
-
core/
modules/ views/ tests/ src/ Functional/ Update/ FormatPluralUpdateTest.php, line 32
Class
- FormatPluralUpdateTest
- Tests the upgrade path for converting format_plural from integer to boolean.
Namespace
Drupal\Tests\views\Functional\UpdateCode
public function testViewsFieldFormatPluralConversion() : void {
$view = View::load('test_format_plural_update');
$data = $view->toArray();
$this->assertSame(0, $data['display']['default']['display_options']['fields']['uid']['format_plural']);
$this->runUpdates();
$view = View::load('test_format_plural_update');
$data = $view->toArray();
// Ensure that integer 0 has become a boolean false.
$this->assertFalse($data['display']['default']['display_options']['fields']['uid']['format_plural']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.