Browse Source

Refactor ManageFeatureTest Composer update Laravel 5.5.14

pull/1/head
Nafies Luthfi 8 years ago
parent
commit
1d1c5917e2
  1. 184
      composer.lock
  2. 77
      resources/lang/id/project.php
  3. 5
      resources/views/features/add-from-other-project.blade.php
  4. 6
      routes/web/projects.php
  5. 126
      tests/Feature/ManageFeaturesTest.php
  6. 8
      tests/TestCase.php

184
composer.lock

@ -78,12 +78,12 @@
"source": {
"type": "git",
"url": "https://github.com/backup-manager/laravel.git",
"reference": "b7feabc809dbd27c8bff73b9a73aea9d267e9d38"
"reference": "091374d1da68af269b19c302553e9cea560b5645"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/backup-manager/laravel/zipball/b7feabc809dbd27c8bff73b9a73aea9d267e9d38",
"reference": "b7feabc809dbd27c8bff73b9a73aea9d267e9d38",
"url": "https://api.github.com/repos/backup-manager/laravel/zipball/091374d1da68af269b19c302553e9cea560b5645",
"reference": "091374d1da68af269b19c302553e9cea560b5645",
"shasum": ""
},
"require": {
@ -131,7 +131,7 @@
}
],
"description": "Database backup manager seamlessly integrated with Laravel 4 or 5 with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more.",
"time": "2017-09-27T05:15:29+00:00"
"time": "2017-09-28T05:28:29+00:00"
},
{
"name": "doctrine/inflector",
@ -637,16 +637,16 @@
},
{
"name": "laravel/framework",
"version": "v5.5.13",
"version": "v5.5.14",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "bfbe20d32ee9f98c89df852847827407a5127be4"
"reference": "26c700eb79e5bb55b59df2c495c9c71f16f43302"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/bfbe20d32ee9f98c89df852847827407a5127be4",
"reference": "bfbe20d32ee9f98c89df852847827407a5127be4",
"url": "https://api.github.com/repos/laravel/framework/zipball/26c700eb79e5bb55b59df2c495c9c71f16f43302",
"reference": "26c700eb79e5bb55b59df2c495c9c71f16f43302",
"shasum": ""
},
"require": {
@ -765,7 +765,7 @@
"framework",
"laravel"
],
"time": "2017-09-24T19:09:38+00:00"
"time": "2017-10-03T17:41:03+00:00"
},
{
"name": "laravelcollective/html",
@ -981,20 +981,20 @@
},
{
"name": "luthfi/formfield",
"version": "0.2.0",
"version": "0.2.1",
"source": {
"type": "git",
"url": "https://github.com/nafiesl/FormField.git",
"reference": "ef00f4446acc3c6d454aef2563510cb1b3439e5f"
"reference": "26a491ef89f187024d26913872c66b42a310b9b0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nafiesl/FormField/zipball/ef00f4446acc3c6d454aef2563510cb1b3439e5f",
"reference": "ef00f4446acc3c6d454aef2563510cb1b3439e5f",
"url": "https://api.github.com/repos/nafiesl/FormField/zipball/26a491ef89f187024d26913872c66b42a310b9b0",
"reference": "26a491ef89f187024d26913872c66b42a310b9b0",
"shasum": ""
},
"require": {
"laravelcollective/html": "5.5.*",
"laravelcollective/html": "5.3.* || 5.4.* || 5.5.*",
"php": ">=7.0"
},
"require-dev": {
@ -1029,7 +1029,7 @@
}
],
"description": "Laravel Form Field the extension of Laravelcollective Form for Laravel 5.3, 5.4 and 5.5 with Twitter Bootstrap 3",
"time": "2017-09-04T23:41:01+00:00"
"time": "2017-10-09T01:45:40+00:00"
},
{
"name": "maatwebsite/excel",
@ -1337,16 +1337,16 @@
},
{
"name": "paragonie/random_compat",
"version": "v2.0.10",
"version": "v2.0.11",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d"
"reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/634bae8e911eefa89c1abfbf1b66da679ac8f54d",
"reference": "634bae8e911eefa89c1abfbf1b66da679ac8f54d",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8",
"reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8",
"shasum": ""
},
"require": {
@ -1381,7 +1381,7 @@
"pseudorandom",
"random"
],
"time": "2017-03-13T16:27:32+00:00"
"time": "2017-09-27T21:40:39+00:00"
},
{
"name": "phpoffice/phpexcel",
@ -1883,16 +1883,16 @@
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.0.1",
"version": "v6.0.2",
"source": {
"type": "git",
"url": "https://github.com/swiftmailer/swiftmailer.git",
"reference": "008f088d535ed3333af5ad804dd4c0eaf97c2805"
"reference": "412333372fb6c8ffb65496a2bbd7321af75733fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/008f088d535ed3333af5ad804dd4c0eaf97c2805",
"reference": "008f088d535ed3333af5ad804dd4c0eaf97c2805",
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/412333372fb6c8ffb65496a2bbd7321af75733fc",
"reference": "412333372fb6c8ffb65496a2bbd7321af75733fc",
"shasum": ""
},
"require": {
@ -1928,26 +1928,26 @@
}
],
"description": "Swiftmailer, free feature-rich PHP mailer",
"homepage": "http://swiftmailer.org",
"homepage": "http://swiftmailer.symfony.com",
"keywords": [
"email",
"mail",
"mailer"
],
"time": "2017-05-20T06:20:27+00:00"
"time": "2017-09-30T22:39:41+00:00"
},
{
"name": "symfony/console",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "a1e1b01293a090cb9ae2ddd221a3251a4a7e4abf"
"reference": "116bc56e45a8e5572e51eb43ab58c769a352366c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/a1e1b01293a090cb9ae2ddd221a3251a4a7e4abf",
"reference": "a1e1b01293a090cb9ae2ddd221a3251a4a7e4abf",
"url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c",
"reference": "116bc56e45a8e5572e51eb43ab58c769a352366c",
"shasum": ""
},
"require": {
@ -2002,20 +2002,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-09-06T16:40:18+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "c5f5263ed231f164c58368efbce959137c7d9488"
"reference": "07447650225ca9223bd5c97180fe7c8267f7d332"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/c5f5263ed231f164c58368efbce959137c7d9488",
"reference": "c5f5263ed231f164c58368efbce959137c7d9488",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/07447650225ca9223bd5c97180fe7c8267f7d332",
"reference": "07447650225ca9223bd5c97180fe7c8267f7d332",
"shasum": ""
},
"require": {
@ -2055,20 +2055,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2017-07-29T21:54:42+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/debug",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "8beb24eec70b345c313640962df933499373a944"
"reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/8beb24eec70b345c313640962df933499373a944",
"reference": "8beb24eec70b345c313640962df933499373a944",
"url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd",
"reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd",
"shasum": ""
},
"require": {
@ -2111,20 +2111,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2017-09-01T13:23:39+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "54ca9520a00386f83bca145819ad3b619aaa2485"
"reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/54ca9520a00386f83bca145819ad3b619aaa2485",
"reference": "54ca9520a00386f83bca145819ad3b619aaa2485",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423",
"reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423",
"shasum": ""
},
"require": {
@ -2174,20 +2174,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2017-07-29T21:54:42+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/finder",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e"
"reference": "773e19a491d97926f236942484cb541560ce862d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/b2260dbc80f3c4198f903215f91a1ac7fe9fe09e",
"reference": "b2260dbc80f3c4198f903215f91a1ac7fe9fe09e",
"url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d",
"reference": "773e19a491d97926f236942484cb541560ce862d",
"shasum": ""
},
"require": {
@ -2223,20 +2223,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2017-07-29T21:54:42+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "2cdc7de1921d1a1c805a13dc05e44a2cd58f5ad3"
"reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/2cdc7de1921d1a1c805a13dc05e44a2cd58f5ad3",
"reference": "2cdc7de1921d1a1c805a13dc05e44a2cd58f5ad3",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8",
"reference": "22cf9c2b1d9f67cc8e75ae7f4eaa60e4c1eff1f8",
"shasum": ""
},
"require": {
@ -2276,20 +2276,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2017-09-06T17:07:39+00:00"
"time": "2017-10-05T23:10:23+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "70f5bb3cdd737624249953b61023411e26be5db7"
"reference": "654f047a78756964bf91b619554f956517394018"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/70f5bb3cdd737624249953b61023411e26be5db7",
"reference": "70f5bb3cdd737624249953b61023411e26be5db7",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/654f047a78756964bf91b619554f956517394018",
"reference": "654f047a78756964bf91b619554f956517394018",
"shasum": ""
},
"require": {
@ -2362,7 +2362,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2017-09-11T16:13:23+00:00"
"time": "2017-10-05T23:40:19+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@ -2533,16 +2533,16 @@
},
{
"name": "symfony/process",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0"
"reference": "fdf89e57a723a29baf536e288d6e232c059697b1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0",
"reference": "b7666e9b438027a1ea0e1ee813ec5042d5d7f6f0",
"url": "https://api.github.com/repos/symfony/process/zipball/fdf89e57a723a29baf536e288d6e232c059697b1",
"reference": "fdf89e57a723a29baf536e288d6e232c059697b1",
"shasum": ""
},
"require": {
@ -2578,20 +2578,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-07-29T21:54:42+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/routing",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "970326dcd04522e1cd1fe128abaee54c225e27f9"
"reference": "2e26fa63da029dab49bf9377b3b4f60a8fecb009"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/970326dcd04522e1cd1fe128abaee54c225e27f9",
"reference": "970326dcd04522e1cd1fe128abaee54c225e27f9",
"url": "https://api.github.com/repos/symfony/routing/zipball/2e26fa63da029dab49bf9377b3b4f60a8fecb009",
"reference": "2e26fa63da029dab49bf9377b3b4f60a8fecb009",
"shasum": ""
},
"require": {
@ -2656,20 +2656,20 @@
"uri",
"url"
],
"time": "2017-07-29T21:54:42+00:00"
"time": "2017-10-02T07:25:00+00:00"
},
{
"name": "symfony/translation",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "add53753d978f635492dfe8cd6953f6a7361ef90"
"reference": "409bf229cd552bf7e3faa8ab7e3980b07672073f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/add53753d978f635492dfe8cd6953f6a7361ef90",
"reference": "add53753d978f635492dfe8cd6953f6a7361ef90",
"url": "https://api.github.com/repos/symfony/translation/zipball/409bf229cd552bf7e3faa8ab7e3980b07672073f",
"reference": "409bf229cd552bf7e3faa8ab7e3980b07672073f",
"shasum": ""
},
"require": {
@ -2721,20 +2721,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2017-07-29T21:54:42+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "89fcb5a73e0ede2be2512234c4e40457bb22b35f"
"reference": "03e3693a36701f1c581dd24a6d6eea2eba2113f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/89fcb5a73e0ede2be2512234c4e40457bb22b35f",
"reference": "89fcb5a73e0ede2be2512234c4e40457bb22b35f",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/03e3693a36701f1c581dd24a6d6eea2eba2113f6",
"reference": "03e3693a36701f1c581dd24a6d6eea2eba2113f6",
"shasum": ""
},
"require": {
@ -2789,7 +2789,7 @@
"debug",
"dump"
],
"time": "2017-08-27T14:52:21+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@ -3915,16 +3915,16 @@
},
{
"name": "phpunit/phpunit",
"version": "6.3.1",
"version": "6.4.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c0ff817b36a827e64bf5f57bc72278150cf30a77"
"reference": "ae6e2e062ff55263c7b04374c190aca45872b26a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c0ff817b36a827e64bf5f57bc72278150cf30a77",
"reference": "c0ff817b36a827e64bf5f57bc72278150cf30a77",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6e2e062ff55263c7b04374c190aca45872b26a",
"reference": "ae6e2e062ff55263c7b04374c190aca45872b26a",
"shasum": ""
},
"require": {
@ -3969,7 +3969,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.3.x-dev"
"dev-master": "6.4.x-dev"
}
},
"autoload": {
@ -3995,7 +3995,7 @@
"testing",
"xunit"
],
"time": "2017-09-24T07:25:54+00:00"
"time": "2017-10-15T06:16:19+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@ -4617,16 +4617,16 @@
},
{
"name": "symfony/dom-crawler",
"version": "v3.3.9",
"version": "v3.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "6b511d7329b203a620f09a2288818d27dcc915ae"
"reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/6b511d7329b203a620f09a2288818d27dcc915ae",
"reference": "6b511d7329b203a620f09a2288818d27dcc915ae",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/40dafd42d5dad7fe5ad4e958413d92a207522ac1",
"reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1",
"shasum": ""
},
"require": {
@ -4669,7 +4669,7 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2017-09-11T15:55:22+00:00"
"time": "2017-10-02T06:42:24+00:00"
},
{
"name": "theseer/tokenizer",

77
resources/lang/id/project.php

@ -1,46 +1,51 @@
<?php
return [
'project' => 'Project',
'projects' => 'Daftar Project',
'name' => 'Nama Project',
'description' => 'Deskripsi Project',
'create' => 'Input Project Baru',
'created' => 'Input Project baru telah berhasil.',
'show' => 'Detail Project',
'edit' => 'Edit Project',
'update' => 'Update Project',
'updated' => 'Update data Project telah berhasil.',
'delete' => 'Hapus Project',
'deleted' => 'Hapus data Project telah berhasil.',
'undeleted' => 'Data Project gagal dihapus.',
'start_date' => 'Tanggal Mulai',
'end_date' => 'Tanggal Selesai',
'proposal_date' => 'Tanggal Proposal',
'project_value' => 'Nilai Project',
'proposal_value' => 'Nilai Proposal',
'work_duration' => 'Durasi',
'cash_in_total' => 'Total Pemasukan',
// Labels
'project' => 'Project',
'projects' => 'Daftar Project',
'work_duration' => 'Durasi',
'cash_in_total' => 'Total Pemasukan',
'cash_out_total' => 'Total Pengeluaran',
'customer' => 'Customer',
'subscriptions' => 'Langganan',
'worker' => 'Pekerja',
'status' => 'Status Project',
'payments' => 'Pembayaran',
'search' => 'Cari Project',
'found' => 'Project ditemukan',
'not_found' => 'Project tidak ditemukan',
'empty' => 'Belum ada Project',
'back_to_index' => 'Kembali ke daftar Project',
// Attribute
'files' => 'List Dokumen',
'features' => 'Daftar Item Pekerjaan',
'cost_proposal' => 'Pengajuan Biaya',
'invoices' => 'List Invoice',
'search' => 'Cari Project',
'found' => 'Project ditemukan',
'not_found' => 'Project tidak ditemukan',
'empty' => 'Belum ada Project',
'back_to_index' => 'Kembali ke daftar Project',
// Actions
'create' => 'Input Project Baru',
'created' => 'Input Project baru telah berhasil.',
'show' => 'Detail Project',
'edit' => 'Edit Project',
'update' => 'Update Project',
'updated' => 'Update data Project telah berhasil.',
'delete' => 'Hapus Project',
'deleted' => 'Hapus data Project telah berhasil.',
'undeleted' => 'Data Project gagal dihapus.',
'show_features' => 'Lihat Fitur',
'features_export_html' => 'Export HTML',
'features_export_excel' => 'Export Excel',
'features_export_progress_excel' => 'Export Progress',
// Attributes
'name' => 'Nama Project',
'description' => 'Deskripsi Project',
'start_date' => 'Tanggal Mulai',
'end_date' => 'Tanggal Selesai',
'proposal_date' => 'Tanggal Proposal',
'project_value' => 'Nilai Project',
'proposal_value' => 'Nilai Proposal',
// Relations
'files' => 'List Dokumen',
'features' => 'Daftar Item Pekerjaan',
'cost_proposal' => 'Pengajuan Biaya',
'invoices' => 'List Invoice',
'customer' => 'Customer',
'worker' => 'Pekerja',
'subscriptions' => 'Langganan',
'status' => 'Status Project',
'payments' => 'Pembayaran',
];

5
resources/views/features/add-from-other-project.blade.php

@ -11,15 +11,14 @@
<div class="panel-heading"><h3 class="panel-title">{{ trans('feature.add_from_other_project') }}</h3></div>
<div class="panel-body">
{!! Form::open(['method'=>'get']) !!}
<?php // echo '<pre>$selectedProject : ', print_r($selectedProject, true), '</pre>'; ?>
<div class="form-group">
<label for="project_id" class="text-primary">{{ trans('project.project') }}</label>
<div class="input-group">
{!! Form::select('project_id', $projects, Request::get('project_id'), [
{!! Form::select('project_id', $projects, request('project_id'), [
'class' => 'form-control customer-select',
'placeholder' => '-- Pilih Project --'
]) !!}
<span class="input-group-btn"><button class="btn btn-default btn-sm" type="submit">Lihat Fitur</button></span>
<span class="input-group-btn"><button class="btn btn-default btn-sm" type="submit">{{ trans('project.show_features') }}</button></span>
</div>
</div>
{!! Form::close() !!}

6
routes/web/projects.php

@ -1,6 +1,6 @@
<?php
Route::group(['middleware' => ['web','role:admin'], 'namespace' => 'Projects'], function() {
Route::group(['middleware' => ['web','role:admin'], 'namespace' => 'Projects'], function () {
/**
* Projects Routes
*/
@ -11,7 +11,7 @@ Route::group(['middleware' => ['web','role:admin'], 'namespace' => 'Projects'],
Route::get('projects/{id}/subscriptions', ['as'=>'projects.subscriptions', 'uses'=>'ProjectsController@subscriptions']);
Route::post('projects/{id}/features-reorder', ['as'=>'projects.features-reorder', 'uses'=>'ProjectsController@featuresReorder']);
Route::patch('projects/{id}/status-update', ['as'=>'projects.status-update', 'uses'=>'ProjectsController@statusUpdate']);
Route::resource('projects','ProjectsController');
Route::resource('projects', 'ProjectsController');
/**
* Project Invoices Routes
@ -27,7 +27,7 @@ Route::group(['middleware' => ['web','role:admin'], 'namespace' => 'Projects'],
Route::post('projects/{id}/features', ['as'=>'features.store', 'uses'=>'FeaturesController@store']);
Route::post('projects/{id}/features/store-from-other-project', ['as'=>'features.store-from-other-project', 'uses'=>'FeaturesController@storeFromOtherProject']);
Route::get('features/{id}/delete', ['as'=>'features.delete', 'uses'=>'FeaturesController@delete']);
Route::resource('features','FeaturesController',['except' => ['create','store']]);
Route::resource('features', 'FeaturesController', ['except' => ['create','store']]);
/**
* Tasks Routes

126
tests/Feature/ManageFeaturesTest.php

@ -13,30 +13,26 @@ class ManageFeaturesTest extends TestCase
/** @test */
public function admin_can_entry_feature()
{
$user = factory(User::class)->create();
$user->assignRole('admin');
$this->actingAs($user);
$user = $this->adminUserSigningIn();
$project = factory(Project::class)->create(['owner_id' => $user->id]);
$worker = factory(User::class)->create();
$worker->assignRole('worker');
$worker = $this->createUser('worker');
$this->visit('projects/'.$project->id.'/features');
$this->seePageIs('projects/'.$project->id.'/features');
$this->see(trans('project.features'));
$this->visit(route('projects.features', $project->id));
$this->click(trans('feature.create'));
$this->seePageIs('projects/'.$project->id.'/features/create');
$this->seePageIs(route('features.create', $project->id));
// Fill Form
$this->type('Nama Fitur Baru', 'name');
$this->type(100000, 'price');
$this->select($worker->id, 'worker_id');
$this->select(1, 'type_id');
$this->type('Similique, eligendi fuga animi? Ipsam magnam laboriosam distinctio officia facere sapiente eius corporis', 'description');
$this->press(trans('feature.create'));
$this->submitForm(trans('feature.create'), [
'name' => 'Nama Fitur Baru',
'price' => 100000,
'worker_id' => $worker->id,
'type_id' => 1,
'description' => 'Similique, eligendi fuga animi?',
]);
$this->see(trans('feature.created'));
$this->seeInDatabase('features', [
'name' => 'Nama Fitur Baru',
'price' => 100000,
@ -59,18 +55,19 @@ class ManageFeaturesTest extends TestCase
$feature = factory(Feature::class)->create(['worker_id' => $user[1]->id, 'project_id' => $project->id]);
$this->visit('features/'.$feature->id.'/edit');
$this->seePageIs('features/'.$feature->id.'/edit');
$this->visit(route('features.edit', $feature->id));
$this->submitForm(trans('feature.update'), [
'name' => 'Nama Fitur Edit',
'price' => 33333,
'worker_id' => $user[2]->id,
'type_id' => 2,
]);
// Fill Form
$this->type('Nama Fitur Edit', 'name');
$this->type(33333, 'price');
$this->select($user[2]->id, 'worker_id');
$this->select(2, 'type_id');
$this->press(trans('feature.update'));
$this->seePageIs(route('features.show', $feature->id));
$this->seePageIs('features/'.$feature->id);
$this->see(trans('feature.updated'));
$this->seeInDatabase('features', [
'name' => 'Nama Fitur Edit',
'price' => 33333,
@ -83,9 +80,7 @@ class ManageFeaturesTest extends TestCase
/** @test */
public function admin_can_delete_a_feature()
{
$user = factory(User::class)->create();
$user->assignRole('admin');
$this->actingAs($user);
$user = $this->adminUserSigningIn();
$project = factory(Project::class)->create(['owner_id' => $user->id]);
$feature = factory(Feature::class)->create(['project_id' => $project->id]);
@ -97,17 +92,14 @@ class ManageFeaturesTest extends TestCase
'project_id' => $project->id,
]);
// $this->visit('projects/'.$project->id.'/features');
// $this->seePageIs('projects/'.$project->id.'/features');
// $this->click('show-feature-'.$feature->id);
// $this->dump();
$this->visit('features/'.$feature->id);
$this->seePageIs('features/'.$feature->id);
// die('hit');
$this->visit(route('features.show', $feature->id));
$this->click(trans('app.edit'));
$this->click(trans('feature.delete'));
$this->press(trans('app.delete_confirm_button'));
$this->seePageIs('projects/'.$project->id.'/features');
$this->seePageIs(route('projects.features', $project->id));
$this->see(trans('feature.deleted'));
$this->notSeeInDatabase('features', [
@ -124,16 +116,14 @@ class ManageFeaturesTest extends TestCase
/** @test */
public function admin_can_see_a_feature()
{
$user = factory(User::class)->create();
$user->assignRole('admin');
$this->actingAs($user);
$user = $this->adminUserSigningIn();
$project = factory(Project::class)->create(['owner_id' => $user->id]);
$feature = factory(Feature::class)->create(['project_id' => $project->id,'type_id' => 1]);
$this->visit('projects/'.$project->id.'/features');
$this->visit(route('projects.features', $project->id));
$this->click('show-feature-'.$feature->id);
$this->seePageIs('features/'.$feature->id);
$this->seePageIs(route('features.show', $project->id));
$this->see(trans('feature.show'));
$this->see($feature->name);
$this->see(formatRp($feature->price));
@ -143,38 +133,21 @@ class ManageFeaturesTest extends TestCase
/** @test */
public function admin_may_clone_many_features_from_other_projects()
{
$user = factory(User::class)->create();
$user->assignRole('admin');
$this->actingAs($user);
$user = $this->adminUserSigningIn();
$projects = factory(Project::class, 2)->create(['owner_id' => $user->id]);
$features = factory(Feature::class, 3)->create(['project_id' => $projects[0]->id]);
$tasks1 = factory(Task::class, 3)->create(['feature_id' => $features[0]->id]);
$tasks2 = factory(Task::class, 3)->create(['feature_id' => $features[1]->id]);
$this->visit('projects/'.$projects[1]->id.'/features');
$this->seePageIs('projects/'.$projects[1]->id.'/features');
$this->visit(route('projects.features', $projects[1]->id));
$this->click(trans('feature.add_from_other_project'));
$this->seePageIs('projects/'.$projects[1]->id.'/features/add-from-other-project');
$this->seePageIs(route('features.add-from-other-project', $projects[1]->id));
$this->select($projects[0]->id, 'project_id');
$this->press('Lihat Fitur');
$this->seePageIs('projects/'.$projects[1]->id.'/features/add-from-other-project?project_id='.$projects[0]->id);
// $this->submitForm(trans('feature.create'), [
// 'feature_ids' => [$features[0]->id,$features[1]->id],
// $features[0]->id.'_task_ids' => [$tasks1[0]->id,$tasks1[1]->id,$tasks1[2]->id],
// $features[1]->id.'_task_ids' => [$tasks2[0]->id,$tasks2[1]->id,$tasks2[2]->id],
// ]);
// $this->check('feature_ids[0]');
// $this->check('feature_ids[1]');
// $this->check($features[0]->id.'_task_ids[0]');
// $this->check($features[0]->id.'_task_ids[1]');
// $this->check($features[0]->id.'_task_ids[2]');
// $this->check($features[1]->id.'_task_ids[0]');
// $this->check($features[1]->id.'_task_ids[1]');
// $this->check($features[1]->id.'_task_ids[2]');
// $this->press(trans('feature.create'));
$this->press(trans('project.show_features'));
$this->seePageIs(route('features.add-from-other-project', [$projects[1]->id, 'project_id' => $projects[0]->id]));
$form = $this->getForm(trans('feature.create'));
$form['feature_ids'][$features[0]->id]->tick();
@ -187,40 +160,31 @@ class ManageFeaturesTest extends TestCase
$form[$features[1]->id.'_task_ids'][$tasks2[2]->id]->tick();
$this->makeRequestUsingForm($form);
$this->seePageIs('projects/'.$projects[1]->id.'/features');
$this->seePageIs(route('projects.features', $projects[1]->id));
$this->see(trans('feature.created_from_other_project'));
$this->seeInDatabase('features', [
'project_id' => $projects[1]->id,
'name' => $features[0]->name,
'price' => $features[0]->price,
'worker_id' => $features[0]->worker_id,
]);
$this->seeInDatabase('features', [
'project_id' => $projects[1]->id,
'name' => $features[1]->name,
'price' => $features[1]->price,
'worker_id' => $features[1]->worker_id,
]);
// $this->seeInDatabase('tasks', [
// 'feature_id' => $features[1]->id,
// 'name' => $tasks1[0]->name,
// 'price' => $features[1]->price,
// 'worker_id' => $features[1]->worker_id,
// ]);
}
/** @test */
public function admin_can_see_unfinished_features_list()
{
$user = factory(User::class)->create();
$user->assignRole('admin');
$this->actingAs($user);
// $projects = factory(Project::class, 2)->create(['owner_id' => $user->id]);
// $features = factory(Feature::class, 3)->create(['project_id'=> array_rand($projects->lists('id','id')->all())]);
// $tasks = factory(Task::class, 10)->create(['feature_id'=> array_rand($features->lists('id','id')->all())]);
$user = $this->adminUserSigningIn();
$this->visit('features');
$this->seePageIs('features');
$this->visit(route('features.index'));
$this->seePageIs(route('features.index'));
}
}

8
tests/TestCase.php

@ -50,6 +50,14 @@ class TestCase extends \Laravel\BrowserKitTesting\TestCase
return $user;
}
protected function createUser($role = 'admin')
{
$user = factory(User::class)->create();
$user->assignRole($role);
return $user;
}
protected function assertFileExistsThenDelete($filePath, $message = null)
{
$this->assertTrue(file_exists($filePath), $message);

Loading…
Cancel
Save