Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
c90fdf22
Unverified
Commit
c90fdf22
authored
Dec 24, 2017
by
Viral Solani
Committed by
GitHub
Dec 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #100 from viralsolani/analysis-zYxwy0
Apply fixes from StyleCI
parents
24a3605a
f84ac048
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
21 deletions
+15
-21
RegisterController.php
app/Http/Controllers/Frontend/Auth/RegisterController.php
+1
-1
UserRepository.php
app/Repositories/Frontend/Access/User/UserRepository.php
+1
-2
2017_12_24_042039_add_null_constraint_on_created_by_on_user_table.php
...42039_add_null_constraint_on_created_by_on_user_table.php
+3
-3
RegistrationTest.php
tests/Feature/RegistrationTest.php
+10
-15
No files found.
app/Http/Controllers/Frontend/Auth/RegisterController.php
View file @
c90fdf22
...
@@ -63,7 +63,7 @@ class RegisterController extends Controller
...
@@ -63,7 +63,7 @@ class RegisterController extends Controller
}*/
}*/
if
(
config
(
'access.users.confirm_email'
)
||
config
(
'access.users.requires_approval'
))
{
if
(
config
(
'access.users.confirm_email'
)
||
config
(
'access.users.requires_approval'
))
{
$user
=
$this
->
user
->
create
(
$request
->
only
(
'first_name'
,
'last_name'
,
'email'
,
'password'
,
'is_term_accept'
));
$user
=
$this
->
user
->
create
(
$request
->
only
(
'first_name'
,
'last_name'
,
'email'
,
'password'
,
'is_term_accept'
));
event
(
new
UserRegistered
(
$user
));
event
(
new
UserRegistered
(
$user
));
return
redirect
(
$this
->
redirectPath
())
->
withFlashSuccess
(
return
redirect
(
$this
->
redirectPath
())
->
withFlashSuccess
(
...
...
app/Repositories/Frontend/Access/User/UserRepository.php
View file @
c90fdf22
...
@@ -79,7 +79,7 @@ class UserRepository extends BaseRepository
...
@@ -79,7 +79,7 @@ class UserRepository extends BaseRepository
}
}
/**
/**
* Create User
* Create User
.
*
*
* @param array $data
* @param array $data
* @param bool $provider
* @param bool $provider
...
@@ -115,7 +115,6 @@ class UserRepository extends BaseRepository
...
@@ -115,7 +115,6 @@ class UserRepository extends BaseRepository
$user
->
confirmed
=
1
;
$user
->
confirmed
=
1
;
}
}
DB
::
transaction
(
function
()
use
(
$user
)
{
DB
::
transaction
(
function
()
use
(
$user
)
{
if
(
$user
->
save
())
{
if
(
$user
->
save
())
{
/*
/*
...
...
database/migrations/2017_12_24_042039_add_null_constraint_on_created_by_on_user_table.php
View file @
c90fdf22
<?php
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddNullConstraintOnCreatedByOnUserTable
extends
Migration
class
AddNullConstraintOnCreatedByOnUserTable
extends
Migration
{
{
...
@@ -14,7 +14,7 @@ class AddNullConstraintOnCreatedByOnUserTable extends Migration
...
@@ -14,7 +14,7 @@ class AddNullConstraintOnCreatedByOnUserTable extends Migration
public
function
up
()
public
function
up
()
{
{
Schema
::
table
(
'users'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
integer
(
'created_by'
)
->
nullable
()
->
change
();
$table
->
integer
(
'created_by'
)
->
nullable
()
->
change
();
});
});
}
}
...
...
tests/Feature/RegistrationTest.php
View file @
c90fdf22
...
@@ -2,16 +2,12 @@
...
@@ -2,16 +2,12 @@
namespace
Tests\Feature
;
namespace
Tests\Feature
;
use
Faker\Generator
;
use
Tests\BrowserKitTestCase
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Event
;
use
App\Events\Frontend\Auth\UserLoggedIn
;
use
App\Events\Frontend\Auth\UserRegistered
;
use
App\Events\Frontend\Auth\UserRegistered
;
use
Illuminate\Support\Facades\Event
;
use
Tests\BrowserKitTestCase
;
class
RegistrationTest
extends
BrowserKitTestCase
class
RegistrationTest
extends
BrowserKitTestCase
{
{
/** @test */
/** @test */
public
function
registration_page_loads_properly
()
public
function
registration_page_loads_properly
()
{
{
...
@@ -42,10 +38,11 @@ class RegistrationTest extends BrowserKitTestCase
...
@@ -42,10 +38,11 @@ class RegistrationTest extends BrowserKitTestCase
}
}
/**
/**
* Test the registration form
* Test the registration form
* Test it works with confirming email on or off, and that the confirm email notification is sent
* Test it works with confirming email on or off, and that the confirm email notification is sent
* Note: Captcha is disabled by default in phpunit.xml.
* Note: Captcha is disabled by default in phpunit.xml.
*/
*/
/** @test */
/** @test */
public
function
test_registration_form
()
public
function
test_registration_form
()
{
{
...
@@ -55,7 +52,6 @@ class RegistrationTest extends BrowserKitTestCase
...
@@ -55,7 +52,6 @@ class RegistrationTest extends BrowserKitTestCase
config
([
'access.users.confirm_email'
=>
false
]);
config
([
'access.users.confirm_email'
=>
false
]);
config
([
'access.users.requires_approval'
=>
false
]);
config
([
'access.users.requires_approval'
=>
false
]);
$this
->
visit
(
'/register'
)
$this
->
visit
(
'/register'
)
->
type
(
'John'
,
'first_name'
)
->
type
(
'John'
,
'first_name'
)
->
type
(
'Doe'
,
'last_name'
)
->
type
(
'Doe'
,
'last_name'
)
...
@@ -67,13 +63,12 @@ class RegistrationTest extends BrowserKitTestCase
...
@@ -67,13 +63,12 @@ class RegistrationTest extends BrowserKitTestCase
->
seePageIs
(
'/'
)
->
seePageIs
(
'/'
)
->
seeInDatabase
(
config
(
'access.users_table'
),
->
seeInDatabase
(
config
(
'access.users_table'
),
[
[
'email'
=>
'john.doe@example.com'
,
'email'
=>
'john.doe@example.com'
,
'first_name'
=>
'John'
,
'first_name'
=>
'John'
,
'last_name'
=>
'Doe'
,
'last_name'
=>
'Doe'
,
'confirmed'
=>
1
,
'confirmed'
=>
1
,
]);
]);
Event
::
assertDispatched
(
UserRegistered
::
class
);
Event
::
assertDispatched
(
UserRegistered
::
class
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment