Browse Source

Merge branch 'master' of https://github.com/damms005/free-pmo into local_master

pull/42/head
Damilola Olowookere 7 years ago
parent
commit
031c805485
  1. 2
      .travis.yml
  2. 6
      README.id.md
  3. 6
      README.md
  4. 2
      app/Entities/Partners/Vendor.php
  5. 10
      app/Entities/Users/User.php
  6. 2
      app/Http/Controllers/Auth/ChangePasswordController.php
  7. 1
      app/Http/Controllers/InstallationController.php
  8. 9
      app/Http/Controllers/Users/UsersController.php
  9. 6
      app/Queries/AdminDashboardQuery.php
  10. 2
      composer.json
  11. 104
      composer.lock
  12. 2
      database/factories/ModelFactory.php
  13. 15
      phpunit.xml
  14. 1
      tests/CreatesApplication.php
  15. 4
      tests/Feature/Auth/ChangePasswordTest.php
  16. 2
      tests/Feature/Auth/LoginTest.php
  17. 5
      tests/Feature/Users/ManageUsersTest.php

2
.travis.yml

@ -5,7 +5,7 @@ php:
before_script: before_script:
- travis_retry composer self-update - travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --dev
- travis_retry composer install --prefer-source --no-interaction
- cp .env.example .env - cp .env.example .env
- php artisan key:generate - php artisan key:generate

6
README.id.md

@ -2,7 +2,7 @@
> *Tell our clients that we are managing our projects professionally.* > *Tell our clients that we are managing our projects professionally.*
[![Build Status](https://travis-ci.org/nafiesl/free-pmo.svg?branch=master)](https://travis-ci.org/nafiesl/free-pmo) [![Build Status](https://travis-ci.org/nafiesl/free-pmo.svg?branch=master)](https://travis-ci.org/nafiesl/free-pmo)
[![StyleCI](https://styleci.io/repos/111558421/shield?branch=develop)](https://styleci.io/repos/111558421)
[![StyleCI](https://styleci.io/repos/111558421/shield?branch=master)](https://styleci.io/repos/111558421)
Free PMO (Project Management Office), software management project untuk *freelancer* dan agensi, dibangun dengan Framework **Laravel 5**. Free PMO (Project Management Office), software management project untuk *freelancer* dan agensi, dibangun dengan Framework **Laravel 5**.
@ -41,7 +41,7 @@ Tujuan utama Free PMO adalah membantu pengelolaan data project dengan mudah dan
Aplikasi ini dapat dipasang dalam server lokal (PC/Laptop) dan server online, dengan spesifikasi berikut : Aplikasi ini dapat dipasang dalam server lokal (PC/Laptop) dan server online, dengan spesifikasi berikut :
#### Spesifikasi minimum server #### Spesifikasi minimum server
1. PHP 7.1.3 (dan memenuhi [server requirement Laravel 5.7](https://laravel.com/docs/5.7#server-requirements)),
1. PHP 7.1.3 (dan memenuhi [server requirement Laravel 5.8](https://laravel.com/docs/5.8#server-requirements)),
2. MySQL atau MariaDB, 2. MySQL atau MariaDB,
3. SQlite (untuk automated testing). 3. SQlite (untuk automated testing).
@ -72,7 +72,7 @@ Project ini dikembangkan oleh [Nafies Luthfi](https://github.com/nafiesl) dan pa
Free PMO dibangun menggunakan [metode TDD](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) dengan bahan dan dukungan dari paket-paket berikut ini : Free PMO dibangun menggunakan [metode TDD](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) dengan bahan dan dukungan dari paket-paket berikut ini :
##### Dependencies ##### Dependencies
* [Framework Laravel](https://laravel.com/docs/5.7) (versi 5.2 s/d 5.7).
* [Framework Laravel](https://laravel.com/docs/5.8) (versi 5.2 s/d 5.8).
* [luthfi/formfield](https://github.com/nafiesl/FormField), Wrapper Form dari [laravelcollective/html](https://github.com/laravelcollective/html) dengan Bootstrap 3. * [luthfi/formfield](https://github.com/nafiesl/FormField), Wrapper Form dari [laravelcollective/html](https://github.com/laravelcollective/html) dengan Bootstrap 3.
* [riskihajar/terbilang](https://github.com/riskihajar/terbilang), membuat angka terbilang (pada fitur cetak kuitansi) dan romawi. * [riskihajar/terbilang](https://github.com/riskihajar/terbilang), membuat angka terbilang (pada fitur cetak kuitansi) dan romawi.

6
README.md

@ -2,7 +2,7 @@
> *Tell our clients that we are managing our projects professionally.* > *Tell our clients that we are managing our projects professionally.*
[![Build Status](https://travis-ci.org/nafiesl/free-pmo.svg?branch=master)](https://travis-ci.org/nafiesl/free-pmo) [![Build Status](https://travis-ci.org/nafiesl/free-pmo.svg?branch=master)](https://travis-ci.org/nafiesl/free-pmo)
[![StyleCI](https://styleci.io/repos/111558421/shield?branch=develop)](https://styleci.io/repos/111558421)
[![StyleCI](https://styleci.io/repos/111558421/shield?branch=master)](https://styleci.io/repos/111558421)
Free PMO (Project Management Office), management project software for *freelancer* and agency, built with **Laravel 5** Framework. Free PMO (Project Management Office), management project software for *freelancer* and agency, built with **Laravel 5** Framework.
@ -43,7 +43,7 @@ Free PMO was built for easy and professional project management.
This application can be installed on local server and online server with these specifications : This application can be installed on local server and online server with these specifications :
#### Server Requirements #### Server Requirements
1. PHP 7.1.3 (and meet [Laravel 5.7 server requirements](https://laravel.com/docs/5.7#server-requirements)),
1. PHP 7.1.3 (and meet [Laravel 5.8 server requirements](https://laravel.com/docs/5.8#server-requirements)),
2. MySQL or MariaDB database, 2. MySQL or MariaDB database,
3. SQlite (for automated testing). 3. SQlite (for automated testing).
@ -74,7 +74,7 @@ This project maintained by [Nafies Luthfi](https://github.com/nafiesl) and devel
Free PMO built with [TDD metode](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) with these ingredients support : Free PMO built with [TDD metode](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) with these ingredients support :
##### Dependencies ##### Dependencies
* [Framework Laravel](https://laravel.com/docs/5.7) (version 5.2 to 5.7).
* [Framework Laravel](https://laravel.com/docs/5.8) (version 5.2 to 5.8).
* [luthfi/formfield](https://github.com/nafiesl/FormField), Bootstrap 3 Form Wrapper for [laravelcollective/html](https://github.com/laravelcollective/html). * [luthfi/formfield](https://github.com/nafiesl/FormField), Bootstrap 3 Form Wrapper for [laravelcollective/html](https://github.com/laravelcollective/html).
* [riskihajar/terbilang](https://github.com/riskihajar/terbilang), create indonesian in-word number (for payment receipt) and roman numeral. * [riskihajar/terbilang](https://github.com/riskihajar/terbilang), create indonesian in-word number (for payment receipt) and roman numeral.

2
app/Entities/Partners/Vendor.php

@ -20,7 +20,7 @@ class Vendor extends Model
*/ */
public function payments() public function payments()
{ {
return $this->morphMany('App\Entities\Payments\Payment', 'partner');
return $this->morphMany('App\Entities\Payments\Payment', 'partner')->orderBy('date');
} }
/** /**

10
app/Entities/Users/User.php

@ -24,16 +24,6 @@ class User extends Authenticatable
protected $hidden = ['password', 'remember_token', 'api_token']; protected $hidden = ['password', 'remember_token', 'api_token'];
/** /**
* Set user password attribute on save.
*
* @param void
*/
public function setPasswordAttribute($value)
{
$this->attributes['password'] = bcrypt($value);
}
/**
* Show user name with link to user detail. * Show user name with link to user detail.
* *
* @return Illuminate\Support\HtmlString * @return Illuminate\Support\HtmlString

2
app/Http/Controllers/Auth/ChangePasswordController.php

@ -43,7 +43,7 @@ class ChangePasswordController extends Controller
if (app('hash')->check($input['old_password'], auth()->user()->password)) { if (app('hash')->check($input['old_password'], auth()->user()->password)) {
$user = auth()->user(); $user = auth()->user();
$user->password = $input['password'];
$user->password = bcrypt($input['password']);
$user->save(); $user->save();
flash(trans('auth.password_changed'), 'success'); flash(trans('auth.password_changed'), 'success');

1
app/Http/Controllers/InstallationController.php

@ -48,6 +48,7 @@ class InstallationController extends Controller
$adminData = $request->only('name', 'email', 'password'); $adminData = $request->only('name', 'email', 'password');
$adminData['api_token'] = str_random(32); $adminData['api_token'] = str_random(32);
$adminData['password'] = bcrypt($adminData['password']);
$admin = User::create($adminData); $admin = User::create($adminData);
$admin->assignRole('admin'); $admin->assignRole('admin');

9
app/Http/Controllers/Users/UsersController.php

@ -37,8 +37,10 @@ class UsersController extends Controller
'role' => 'required|array', 'role' => 'required|array',
]); ]);
if (!$userData['password']) {
$userData['password'] = \Option::get('password_default', 'member');
if ($userData['password']) {
$userData['password'] = bcrypt($userData['password']);
} else {
$userData['password'] = bcrypt(\Option::get('password_default', 'member'));
} }
$userData['api_token'] = str_random(32); $userData['api_token'] = str_random(32);
@ -90,6 +92,9 @@ class UsersController extends Controller
'lang' => 'required|string|in:en,id', 'lang' => 'required|string|in:en,id',
]); ]);
if ($userData['password']) {
$userData['password'] = bcrypt($userData['password']);
}
$user->update($userData); $user->update($userData);
\DB::table('user_roles')->where(['user_id' => $user->id])->delete(); \DB::table('user_roles')->where(['user_id' => $user->id])->delete();

6
app/Queries/AdminDashboardQuery.php

@ -26,7 +26,7 @@ class AdminDashboardQuery
public function totalEarnings($year) public function totalEarnings($year)
{ {
$totalEarnings = 0; $totalEarnings = 0;
$payments = Payment::where('date', 'like', $year.'%')->get();
$payments = Payment::whereYear('date', $year)->get();
foreach ($payments as $payment) { foreach ($payments as $payment) {
if ($payment->in_out == 1) { if ($payment->in_out == 1) {
$totalEarnings += $payment->amount; $totalEarnings += $payment->amount;
@ -47,7 +47,7 @@ class AdminDashboardQuery
*/ */
public function totalFinishedProjects($year) public function totalFinishedProjects($year)
{ {
return Project::where('status_id', 4)->where('start_date', 'like', $year.'%')->count();
return Project::where('status_id', 4)->whereYear('start_date', $year)->count();
} }
/** /**
@ -61,7 +61,7 @@ class AdminDashboardQuery
{ {
// On Progress, Done, On Hold // On Progress, Done, On Hold
$projects = Project::whereIn('status_id', [2, 3, 6]) $projects = Project::whereIn('status_id', [2, 3, 6])
->where('start_date', 'like', $year.'%')
->whereYear('start_date', $year)
->with('payments') ->with('payments')
->get(); ->get();

2
composer.json

@ -19,7 +19,7 @@
"barryvdh/laravel-debugbar": "^3.1", "barryvdh/laravel-debugbar": "^3.1",
"fzaninotto/faker": "^1.4", "fzaninotto/faker": "^1.4",
"johnkary/phpunit-speedtrap": "^3.0", "johnkary/phpunit-speedtrap": "^3.0",
"luthfi/simple-crud-generator": "^1.2",
"luthfi/simple-crud-generator": "1.2.*",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.0" "phpunit/phpunit": "^7.0"
}, },

104
composer.lock

@ -1365,16 +1365,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "1.36.2",
"version": "1.37.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9"
"reference": "5be4fdf97076a685b23efdedfc2b73ad0c5eab70"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9",
"reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/5be4fdf97076a685b23efdedfc2b73ad0c5eab70",
"reference": "5be4fdf97076a685b23efdedfc2b73ad0c5eab70",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1419,7 +1419,7 @@
"datetime", "datetime",
"time" "time"
], ],
"time": "2018-12-28T10:07:33+00:00"
"time": "2019-04-19T10:27:42+00:00"
}, },
{ {
"name": "nexmo/client", "name": "nexmo/client",
@ -2437,7 +2437,7 @@
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/css-selector.git", "url": "https://github.com/symfony/css-selector.git",
@ -2490,7 +2490,7 @@
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/debug.git", "url": "https://github.com/symfony/debug.git",
@ -2546,7 +2546,7 @@
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
@ -2610,7 +2610,7 @@
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
@ -2659,16 +2659,16 @@
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "5b7ab6beaa5b053b8d3c9b13367ada9b292e12e1"
"reference": "1ea878bd3af18f934dedb8c0de60656a9a31a718"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/5b7ab6beaa5b053b8d3c9b13367ada9b292e12e1",
"reference": "5b7ab6beaa5b053b8d3c9b13367ada9b292e12e1",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/1ea878bd3af18f934dedb8c0de60656a9a31a718",
"reference": "1ea878bd3af18f934dedb8c0de60656a9a31a718",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2709,20 +2709,20 @@
], ],
"description": "Symfony HttpFoundation Component", "description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-03-30T15:58:42+00:00"
"time": "2019-05-01T08:36:31+00:00"
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-kernel.git", "url": "https://github.com/symfony/http-kernel.git",
"reference": "72f5f8f9dd6e6fbda0220ded537610ad20fa2ce8"
"reference": "a7713bc522f1a1cdf0b39f809fa4542523fc3114"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/72f5f8f9dd6e6fbda0220ded537610ad20fa2ce8",
"reference": "72f5f8f9dd6e6fbda0220ded537610ad20fa2ce8",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/a7713bc522f1a1cdf0b39f809fa4542523fc3114",
"reference": "a7713bc522f1a1cdf0b39f809fa4542523fc3114",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2798,7 +2798,7 @@
], ],
"description": "Symfony HttpKernel Component", "description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-04-16T07:20:25+00:00"
"time": "2019-05-01T13:31:08+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@ -3095,7 +3095,7 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
@ -3144,16 +3144,16 @@
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/routing.git", "url": "https://github.com/symfony/routing.git",
"reference": "b9f16550d76897ab0a86c198f8008c6578a5068f"
"reference": "f4e43bb0dff56f0f62fa056c82d7eadcdb391bab"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/b9f16550d76897ab0a86c198f8008c6578a5068f",
"reference": "b9f16550d76897ab0a86c198f8008c6578a5068f",
"url": "https://api.github.com/repos/symfony/routing/zipball/f4e43bb0dff56f0f62fa056c82d7eadcdb391bab",
"reference": "f4e43bb0dff56f0f62fa056c82d7eadcdb391bab",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3216,20 +3216,20 @@
"uri", "uri",
"url" "url"
], ],
"time": "2019-04-03T13:26:22+00:00"
"time": "2019-04-27T09:38:08+00:00"
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
"reference": "46c0dede1f925383d13dc783857be2c41efd0b24"
"reference": "181a426dd129cb496f12d7e7555f6d0b37a7615b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/46c0dede1f925383d13dc783857be2c41efd0b24",
"reference": "46c0dede1f925383d13dc783857be2c41efd0b24",
"url": "https://api.github.com/repos/symfony/translation/zipball/181a426dd129cb496f12d7e7555f6d0b37a7615b",
"reference": "181a426dd129cb496f12d7e7555f6d0b37a7615b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3291,20 +3291,20 @@
], ],
"description": "Symfony Translation Component", "description": "Symfony Translation Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-04-10T16:20:36+00:00"
"time": "2019-05-01T12:55:36+00:00"
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "f42850fa32b8d7a35a75510810f6ef597674be74"
"reference": "3c4084cb1537c0e2ad41aad622bbf55a44a5c9ce"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/f42850fa32b8d7a35a75510810f6ef597674be74",
"reference": "f42850fa32b8d7a35a75510810f6ef597674be74",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/3c4084cb1537c0e2ad41aad622bbf55a44a5c9ce",
"reference": "3c4084cb1537c0e2ad41aad622bbf55a44a5c9ce",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3367,7 +3367,7 @@
"debug", "debug",
"dump" "dump"
], ],
"time": "2019-04-11T11:27:41+00:00"
"time": "2019-05-01T12:55:36+00:00"
}, },
{ {
"name": "tijsverkoyen/css-to-inline-styles", "name": "tijsverkoyen/css-to-inline-styles",
@ -4251,16 +4251,16 @@
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "4.3.0",
"version": "4.3.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "94fd0001232e47129dd3504189fa1c7225010d08"
"reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
"reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
"reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4298,7 +4298,7 @@
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2017-11-30T07:14:17+00:00"
"time": "2019-04-30T17:48:53+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
@ -4664,16 +4664,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "7.5.8",
"version": "7.5.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c29c0525cf4572c11efe1db49a8b8aee9dfac58a"
"reference": "134669cf0eeac3f79bc7f0c793efbc158bffc160"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c29c0525cf4572c11efe1db49a8b8aee9dfac58a",
"reference": "c29c0525cf4572c11efe1db49a8b8aee9dfac58a",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/134669cf0eeac3f79bc7f0c793efbc158bffc160",
"reference": "134669cf0eeac3f79bc7f0c793efbc158bffc160",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4744,7 +4744,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2019-03-26T13:23:54+00:00"
"time": "2019-04-19T15:50:46+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
@ -4913,16 +4913,16 @@
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "4.1.0",
"version": "4.2.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "6fda8ce1974b62b14935adc02a9ed38252eca656"
"reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6fda8ce1974b62b14935adc02a9ed38252eca656",
"reference": "6fda8ce1974b62b14935adc02a9ed38252eca656",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404",
"reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4937,7 +4937,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
} }
}, },
"autoload": { "autoload": {
@ -4962,7 +4962,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2019-02-01T05:27:49+00:00"
"time": "2019-05-05T09:05:15+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
@ -5314,7 +5314,7 @@
}, },
{ {
"name": "symfony/dom-crawler", "name": "symfony/dom-crawler",
"version": "v4.2.6",
"version": "v4.2.8",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/dom-crawler.git", "url": "https://github.com/symfony/dom-crawler.git",

2
database/factories/ModelFactory.php

@ -10,7 +10,7 @@ $factory->define(User::class, function (Faker\Generator $faker) {
return [ return [
'name' => $faker->name, 'name' => $faker->name,
'email' => $faker->unique()->email, 'email' => $faker->unique()->email,
'password' => 'member',
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10), 'remember_token' => str_random(10),
'api_token' => str_random(32), 'api_token' => str_random(32),
'lang' => 'en', 'lang' => 'en',

15
phpunit.xml

@ -20,23 +20,14 @@
</filter> </filter>
<php> <php>
<env name="APP_ENV" value="testing"/> <env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/> <env name="CACHE_DRIVER" value="array"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/> <env name="QUEUE_DRIVER" value="sync"/>
<env name="DB_CONNECTION" value="sqlite"/> <env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/> <env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_DRIVER" value="log"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="FILESYSTEM_DRIVER" value="test_storage"/> <env name="FILESYSTEM_DRIVER" value="test_storage"/>
</php> </php>
<listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener">
<arguments>
<array>
<element key="reportLength">
<integer>15</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
</phpunit> </phpunit>

1
tests/CreatesApplication.php

@ -23,7 +23,6 @@ trait CreatesApplication
$app = require __DIR__.'/../bootstrap/app.php'; $app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap(); $app->make(Kernel::class)->bootstrap();
\Hash::setRounds(5);
return $app; return $app;
} }

4
tests/Feature/Auth/ChangePasswordTest.php

@ -24,12 +24,12 @@ class ChangePasswordTest extends TestCase
]); ]);
$this->see(trans('auth.old_password_failed')); $this->see(trans('auth.old_password_failed'));
$this->assertTrue( $this->assertTrue(
app('hash')->check('member', $user->password),
app('hash')->check('secret', $user->password),
'The password shouldn\'t changed!' 'The password shouldn\'t changed!'
); );
$this->submitForm(trans('auth.change_password'), [ $this->submitForm(trans('auth.change_password'), [
'old_password' => 'member',
'old_password' => 'secret',
'password' => 'rahasia', 'password' => 'rahasia',
'password_confirmation' => 'rahasia', 'password_confirmation' => 'rahasia',
]); ]);

2
tests/Feature/Auth/LoginTest.php

@ -19,7 +19,7 @@ class LoginTest extends TestCase
$this->submitForm(trans('auth.login'), [ $this->submitForm(trans('auth.login'), [
'email' => 'email@mail.com', 'email' => 'email@mail.com',
'password' => 'member',
'password' => 'secret',
]); ]);
$this->see(trans('auth.welcome', ['name' => $user->name])); $this->see(trans('auth.welcome', ['name' => $user->name]));

5
tests/Feature/Users/ManageUsersTest.php

@ -113,6 +113,11 @@ class ManageUsersTest extends TestCase
'user_id' => $user2->id, 'user_id' => $user2->id,
'role_id' => 2, 'role_id' => 2,
]); ]);
$this->assertTrue(
app('hash')->check('password', $user2->fresh()->password),
'The password should changed!'
);
} }
/** @test */ /** @test */

Loading…
Cancel
Save