-
-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.x' into feature/asset-container-validation
- Loading branch information
Showing
10 changed files
with
105 additions
and
21 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
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,18 @@ | ||
<?php | ||
|
||
return [ | ||
'relativeTime.future' => 'om %s', | ||
'relativeTime.past' => '%s siden', | ||
'relativeTime.s' => 'få sekunder siden', | ||
'relativeTime.ss' => '%d sekunder', | ||
'relativeTime.m' => 'et minut', | ||
'relativeTime.mm' => '%d minutter', | ||
'relativeTime.h' => 'en time', | ||
'relativeTime.hh' => '%d timer', | ||
'relativeTime.d' => 'en dag', | ||
'relativeTime.dd' => '%d dage', | ||
'relativeTime.M' => 'en måned', | ||
'relativeTime.MM' => '%d måneder', | ||
'relativeTime.y' => 'et år', | ||
'relativeTime.yy' => '%d år', | ||
]; |
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
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 |
---|---|---|
|
@@ -4,7 +4,9 @@ | |
|
||
use Statamic\Facades\Blueprint; | ||
use Statamic\Facades\Parse; | ||
use Statamic\Facades\Role; | ||
use Statamic\Facades\User; | ||
use Statamic\Facades\UserGroup; | ||
use Statamic\Statamic; | ||
use Tests\NormalizesHtml; | ||
use Tests\PreventSavingStacheItemsToDisk; | ||
|
@@ -339,6 +341,35 @@ public function it_will_use_redirect_query_param_off_url() | |
$this->assertStringContainsString($expectedErrorRedirect, $output); | ||
} | ||
|
||
/** @test */ | ||
public function it_ensures_some_fields_arent_saved() | ||
{ | ||
UserGroup::make('client')->title('Client')->save(); | ||
Role::make('admin')->title('Admin')->save(); | ||
|
||
$this->assertNull(User::findByEmail('[email protected]')); | ||
$this->assertFalse(auth()->check()); | ||
|
||
$this | ||
->post('/!/auth/register', [ | ||
'email' => '[email protected]', | ||
'password' => 'chewbacca', | ||
'password_confirmation' => 'chewbacca', | ||
'groups' => ['client'], | ||
'roles' => ['admin'], | ||
'super' => true, | ||
]) | ||
->assertSessionHasNoErrors() | ||
->assertLocation('/'); | ||
|
||
$user = User::findByEmail('[email protected]'); | ||
|
||
$this->assertEquals($user->groups()->count(), 0); | ||
$this->assertEquals($user->roles()->count(), 0); | ||
$this->assertNull($user->get('super')); | ||
$this->assertNull($user->get('password_confirmation')); | ||
} | ||
|
||
private function useCustomBlueprint() | ||
{ | ||
$blueprint = Blueprint::make()->setContents([ | ||
|