-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from arshad/321-max-length-first-name-last-name
[#321] Increase max_length for first_name and last_name fields
- Loading branch information
Showing
4 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright 2020 Google Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License version 2 as published by the | ||
* Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
* License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, write to the Free Software Foundation, Inc., 51 | ||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
namespace Drupal\Tests\apigee_edge\Kernel; | ||
|
||
use Drupal\KernelTests\KernelTestBase; | ||
use Drupal\user\Entity\User; | ||
|
||
/** | ||
* Test create operations for User entity type. | ||
* | ||
* @group apigee_edge | ||
* @group apigee_edge_kernel | ||
*/ | ||
class UserCreateTest extends KernelTestBase { | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected static $modules = [ | ||
'user', | ||
'system', | ||
'apigee_edge', | ||
'key', | ||
]; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function setUp() { | ||
parent::setUp(); | ||
|
||
$this->installSchema('system', ['sequences']); | ||
$this->installSchema('user', ['users_data']); | ||
$this->installEntitySchema('user'); | ||
} | ||
|
||
/** | ||
* Test user create. | ||
*/ | ||
public function testUserCreate() { | ||
$user = User::create([ | ||
'mail' => $this->randomMachineName() . '@example.com', | ||
'name' => $this->randomMachineName(), | ||
'first_name' => $this->randomMachineName(64), | ||
'last_name' => $this->randomMachineName(64), | ||
]); | ||
|
||
$this->assertEquals(SAVED_NEW, $user->save()); | ||
} | ||
|
||
} |