function UserFieldValueTest::testFastPathHandlesMissingRawValues
Same name and namespace in other branches
- main core/modules/user/tests/src/Kernel/UserFieldValueTest.php \Drupal\Tests\user\Kernel\UserFieldValueTest::testFastPathHandlesMissingRawValues()
Tests that missing raw values still match the regular field API.
File
-
core/
modules/ user/ tests/ src/ Kernel/ UserFieldValueTest.php, line 76
Class
- UserFieldValueTest
- Tests fast scalar field access on the user entity.
Namespace
Drupal\Tests\user\KernelCode
public function testFastPathHandlesMissingRawValues() : void {
$fast_user = User::create([
'name' => 'fresh-user',
'mail' => 'fresh-user@example.com',
]);
$typed_user = User::create([
'name' => 'fresh-user',
'mail' => 'fresh-user@example.com',
]);
$this->assertSame($typed_user->get('timezone')->value, $fast_user->getTimeZone());
$this->assertSame($typed_user->get('status')->value == 1, $fast_user->isActive());
$this->assertEquals($typed_user->get('access')->value, $fast_user->getLastAccessedTime());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.