Browse Source

Update 2016-08-23.11.17

Add Subscription tab to project.show
Add new option on options.index view
Split Project features between Main Features and Additional Features
pull/1/head
Nafies Luthfi 9 years ago
parent
commit
8f50768f4a
  1. 18
      app/Entities/Projects/Project.php
  2. 9
      app/Entities/Projects/ProjectsRepository.php
  3. 5
      app/Entities/Subscriptions/Subscription.php
  4. 4
      app/Entities/Subscriptions/SubscriptionsRepository.php
  5. 18
      app/Http/Controllers/Projects/ProjectsController.php
  6. 7
      app/Http/Controllers/References/OptionsController.php
  7. 1
      app/Http/routes/projects.php
  8. 61
      config/backup-manager.php
  9. 1
      database/factories/ModelFactory.php
  10. 2
      resources/lang/id/option.php
  11. 1
      resources/lang/id/project.php
  12. 2
      resources/views/features/add-from-other-project.blade.php
  13. 4
      resources/views/features/partials/feature-tasks-operation.blade.php
  14. 2
      resources/views/masters/delete.blade.php
  15. 81
      resources/views/options/index.blade.php
  16. 2
      resources/views/projects/features.blade.php
  17. 14
      resources/views/projects/partials/nav-tabs.blade.php
  18. 43
      resources/views/projects/subscriptions.blade.php
  19. 4
      resources/views/subscriptions/create.blade.php
  20. 1
      resources/views/subscriptions/edit.blade.php
  21. 3
      resources/views/subscriptions/index.blade.php
  22. 16
      tests/ManageFeaturesTest.php
  23. 1
      tests/ManagePaymentsTest.php
  24. 10
      tests/ManageSubscriptionsTest.php
  25. 4
      tests/ManageTasksTest.php

18
app/Entities/Projects/Project.php

@ -4,6 +4,7 @@ namespace App\Entities\Projects;
use App\Entities\Payments\Payment;
use App\Entities\Projects\ProjectPresenter;
use App\Entities\Subscriptions\Subscription;
use App\Entities\Users\User;
use Illuminate\Database\Eloquent\Model;
use Laracasts\Presenter\PresentableTrait;
@ -16,11 +17,26 @@ class Project extends Model {
protected $guarded = ['id','created_at','updated_at'];
// protected $dates = ['start_date','end_date'];
public function features()
public function allFeatures()
{
return $this->hasMany(Feature::class)->orderBy('position');
}
public function features()
{
return $this->hasMany(Feature::class)->orderBy('position')->whereTypeId(1);
}
public function additionalFeatures()
{
return $this->hasMany(Feature::class)->orderBy('position')->whereTypeId(2);
}
public function subscriptions()
{
return $this->hasMany(Subscription::class);
}
public function payments()
{
return $this->hasMany(Payment::class)->orderBy('date','desc');

9
app/Entities/Projects/ProjectsRepository.php

@ -81,21 +81,22 @@ class ProjectsRepository extends BaseRepository
$project->payments()->delete();
// Delete features tasks
$featureIds = $project->features->lists('id')->all();
$featureIds = $project->allFeatures->lists('id')->all();
DB::table('tasks')->whereIn('feature_id', $featureIds)->delete();
// Delete features
$project->features()->delete();
$project->allFeatures()->delete();
// Delete project
$project->delete();
DB::commit();
return 'deleted';
}
public function getProjectFeatures($projectId)
public function getProjectFeatures($projectId, $type = 1)
{
return Feature::whereProjectId($projectId)->orderBy('position')->with('worker','tasks')->get();
return Feature::whereProjectId($projectId)->whereTypeId($type)->orderBy('position')->with('worker','tasks')->get();
}
public function updateStatus($statusId, $projectId)

5
app/Entities/Subscriptions/Subscription.php

@ -25,4 +25,9 @@ class Subscription extends Model {
return $this->belongsTo(User::class,'customer_id');
}
public function status()
{
return $this->status_id ? 'Aktif' : 'Non Aktif';
}
}

4
app/Entities/Subscriptions/SubscriptionsRepository.php

@ -18,6 +18,8 @@ class SubscriptionsRepository extends BaseRepository
public function getAll($q)
{
return $this->model->orderBy('due_date')->where('domain_name','like','%' . $q . '%')->paginate($this->_paginate);
return $this->model->orderBy('due_date')
->where('domain_name','like','%' . $q . '%')
->paginate($this->_paginate);
}
}

18
app/Http/Controllers/Projects/ProjectsController.php

@ -84,19 +84,27 @@ class ProjectsController extends Controller {
return redirect()->route('projects.index');
}
public function features($projectId)
public function features(Request $req, $projectId)
{
$featureType = $req->get('feature_type', 1);
$project = $this->repo->requireById($projectId);
$features = $this->repo->getProjectFeatures($projectId);
$features = $this->repo->getProjectFeatures($projectId, $featureType);
return view('projects.features', compact('project','features'));
}
public function featuresExport($projectId, $type = 'excel')
public function subscriptions($projectId)
{
$project = $this->repo->requireById($projectId);
$features = $this->repo->getProjectFeatures($projectId);
return view('projects.subscriptions', compact('project'));
}
public function featuresExport(Request $req, $projectId, $exportType = 'excel')
{
$featureType = $req->get('feature_type', 1);
$project = $this->repo->requireById($projectId);
$features = $this->repo->getProjectFeatures($projectId, $featureType);
// return view('projects.features-export', compact('project','features'));
if ($type == 'excel') {
if ($exportType == 'excel') {
\Excel::create(str_slug(trans('project.features') . '-' . $project->name), function($excel) use ($project, $features) {
$excel->sheet('testng', function($sheet) use ($project, $features) {
$sheet->loadView('projects.features-export-excel',compact('project','features'));

7
app/Http/Controllers/References/OptionsController.php

@ -20,8 +20,13 @@ class OptionsController extends Controller {
public function index(Request $req)
{
$editableOption = null;
$options = $this->repo->getAll();
return view('options.index',compact('options'));
if (in_array($req->get('action'), ['del','edit']) && $req->has('id'))
$editableOption = $this->repo->requireById($req->get('id'));
return view('options.index',compact('options','editableOption'));
}
public function create()

1
app/Http/routes/projects.php

@ -8,6 +8,7 @@ Route::group(['middleware' => ['web','role:admin'], 'namespace' => 'Projects'],
Route::get('projects/{id}/features', ['as'=>'projects.features', 'uses'=>'ProjectsController@features']);
Route::get('projects/{id}/features-export/{type?}', ['as'=>'projects.features-export', 'uses'=>'ProjectsController@featuresExport']);
Route::get('projects/{id}/payments', ['as'=>'projects.payments', 'uses'=>'ProjectsController@payments']);
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');

61
config/backup-manager.php

@ -0,0 +1,61 @@
<?php
return [
'local' => [
'type' => 'Local',
'root' => storage_path('app'),
],
's3' => [
'type' => 'AwsS3',
'key' => '',
'secret' => '',
'region' => 'us-east-1',
'bucket' => '',
'root' => '',
],
'gcs' => [
'type' => 'Gcs',
'key' => '',
'secret' => '',
'bucket' => '',
'root' => '',
],
'rackspace' => [
'type' => 'Rackspace',
'username' => '',
'key' => '',
'container' => '',
'zone' => '',
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'root' => '',
],
'dropbox' => [
'type' => 'Dropbox',
'token' => '',
'key' => '',
'secret' => '',
'app' => '',
'root' => '',
],
'ftp' => [
'type' => 'Ftp',
'host' => '',
'username' => '',
'password' => '',
'port' => 21,
'passive' => true,
'ssl' => true,
'timeout' => 30,
'root' => '',
],
'sftp' => [
'type' => 'Sftp',
'host' => '',
'username' => '',
'password' => '',
'port' => 21,
'timeout' => 10,
'privateKey' => '',
'root' => '',
],
];

1
database/factories/ModelFactory.php

@ -75,6 +75,7 @@ $factory->define(Subscription::class, function (Faker\Generator $faker) {
return [
'project_id' => factory(Project::class)->create()->id,
'status_id' => 1,
'domain_name' => 'www.' . str_random(10) . '.com',
'domain_price' => 125000,
'epp_code' => str_random(10),

2
resources/lang/id/option.php

@ -1,9 +1,11 @@
<?php
return [
'options' => 'Daftar Option',
'create' => 'Buat Option Baru',
'created' => 'Option baru berhasil dibuat',
'updated' => 'Option berhasil disimpan',
'delete' => 'Hapus Option',
'deleted' => 'Option berhasil dihapus',
'undeleted' => 'Option tidak berhasil dihapus',
'key' => 'Key',

1
resources/lang/id/project.php

@ -26,6 +26,7 @@ return [
'features' => 'Daftar Fitur',
'features_export_html' => 'Export Fitur ke HTML',
'features_export_excel' => 'Export Fitur ke Excel',
'subscriptions' => 'Langganan',
'worker' => 'Pekerja',
'status' => 'Status Project',
'payments' => 'Pembayaran',

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

@ -26,7 +26,7 @@
@if ($selectedProject)
{!! Form::open(['route'=>['features.store-from-other-project', $project->id]]) !!}
<ul class="list-unstyled">
@forelse($selectedProject->features as $key => $feature)
@forelse($selectedProject->allFeatures as $key => $feature)
<li>
<label for="feature_id_{{ $feature->id }}">
{!! Form::checkbox('feature_ids[' . $feature->id . ']', $feature->id, null, ['id' => 'feature_id_' . $feature->id]) !!}

4
resources/views/features/partials/feature-tasks-operation.blade.php

@ -29,7 +29,7 @@
{!! FormField::text('progress', ['addon' => ['after' => '%']]) !!}
</div>
<div class="col-md-6">
{!! FormField::select('feature_id', $feature->project->features->lists('name','id'), ['label' => 'Pindahkan ke Fitur lain']) !!}
{!! FormField::select('feature_id', $feature->project->allFeatures->lists('name','id'), ['label' => 'Pindahkan ke Fitur lain']) !!}
</div>
</div>
{!! Form::submit(trans('task.update'), ['class' => 'btn btn-warning']) !!}
@ -43,7 +43,7 @@
<div class="panel-heading"><h3 class="panel-title">{{ trans('task.delete') }}</h3></div>
<div class="panel-body">
<div>{{ $editableTask->name }}</div>
<div class="small text-info">{!! $editableTask->description !!}</div>
<div class="small text-info">{!! nl2br($editableTask->description) !!}</div>
</div>
<div class="panel-footer">
{{ trans('app.delete_confirm') }}

2
resources/views/masters/delete.blade.php

@ -5,7 +5,7 @@
@section('content')
<h1 class="page-header">
<div class="pull-right">
{!! delete_button(['route'=>['masters.destroy',$master->id]], trans('app.delete_confirm_button'), ['class'=>'btn btn-danger'], ['master_id'=>$master->id]) !!}
{!! FormField::delete(['route'=>['masters.destroy',$master->id]], trans('app.delete_confirm_button'), ['class'=>'btn btn-danger'], ['master_id'=>$master->id]) !!}
</div>
{{ trans('app.delete_confirm') }}
{!! link_to_route('masters.show', trans('app.cancel'), [$master->id], ['class' => 'btn btn-default']) !!}

81
resources/views/options/index.blade.php

@ -2,30 +2,65 @@
@section('content')
<h1 class="page-header">
{!! link_to_route('options.create', trans('option.create'), [], ['class'=>'btn btn-success pull-right']) !!}
Options
{{ trans('option.options') }}
</h1>
{{ FormField::price('price') }}
<div class="row">
<div class="col-md-8">
{!! Form::open(['route'=>'options.save', 'method'=>'patch']) !!}
<table class="table table-condensed">
<tbody>
@forelse($options as $option)
<tr>
<td>
{{ str_split_ucwords($option->key) }}
{!! link_to_route('options.index', 'x', ['id' => $option->id,'action' => 'del'], ['class'=>'btn btn-danger btn-xs pull-right']) !!}
</td>
<td>{!! Form::textarea($option->key, $option->value, ['class'=>'form-control','rows'=>3]) !!}</td>
</tr>
@empty
<tr>
<td>No option found</td>
</tr>
@endforelse
</tbody>
</table>
<div class="form-group">
{!! Form::submit(trans('app.update'), ['class'=>'btn btn-warning']) !!}
</div>
{!! Form::close() !!}
</div>
{!! Form::open(['route'=>'options.save', 'method'=>'patch']) !!}
<table class="table table-condensed">
<tbody>
@forelse($options as $option)
<tr>
<td>
{{ str_split_ucwords($option->key) }}
{!! link_to_route('options.delete', 'x', [$option->id], ['class'=>'btn btn-danger btn-xs pull-right']) !!}
</td>
<td>{!! Form::textarea($option->key, $option->value, ['class'=>'form-control','rows'=>3]) !!}</td>
</tr>
@empty
<tr>
<td>No option found</td>
</tr>
@endforelse
</tbody>
</table>
<div class="form-group">
{!! Form::submit(trans('app.update'), ['class'=>'btn btn-warning']) !!}
<div class="col-md-4">
@if (Request::get('action') == 'del' && $editableOption)
<div class="panel panel-info">
<div class="panel-heading"><h3 class="panel-title">{{ trans('option.delete') }}</h3></div>
<div class="panel-body">
<p>{{ trans('app.delete_confirm') }}</p>
<table class="table table-condensed">
<tbody>
<tr><th>{{ str_split_ucwords($editableOption->key) }}</th><td>{{ $editableOption->value }}</td></tr>
</tbody>
</table>
</div>
<div class="panel-footer">
{!! FormField::delete(['route'=>['options.destroy',$editableOption->id]], trans('app.delete'), ['class'=>'btn btn-danger'], ['option_id'=>$option->id]) !!}
{!! link_to_route('options.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) !!}
</div>
</div>
@endif
{!! Form::open(['route'=>'options.store']) !!}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Option Data</h3></div>
<div class="panel-body">
{!! FormField::text('key') !!}
{!! FormField::textarea('value') !!}
</div>
<div class="panel-footer">
{!! Form::submit(trans('app.add'), ['class'=>'btn btn-primary']) !!}
</div>
</div>
{!! Form::close() !!}
</div>
</div>
{!! Form::close() !!}
@endsection

2
resources/views/projects/features.blade.php

@ -47,7 +47,7 @@
{{-- <td>{{ $feature->worker->name }}</td> --}}
<td class="text-center">
{!! link_to_route('features.show', trans('task.create'),[$feature->id],['class' => 'btn btn-default btn-xs']) !!}
{!! link_to_route('features.show', trans('app.show'),[$feature->id],['class' => 'btn btn-info btn-xs']) !!}
{!! link_to_route('features.show', trans('app.show'),[$feature->id],['class' => 'btn btn-info btn-xs','id' => 'show-feature-' . $feature->id]) !!}
{!! link_to_route('features.edit', trans('app.edit'),[$feature->id],['class' => 'btn btn-warning btn-xs']) !!}
</td>
</tr>

14
resources/views/projects/partials/nav-tabs.blade.php

@ -1,7 +1,7 @@
@if (Request::segment(3) == 'features')
<div class="pull-right">
{!! link_to_route('projects.features-export', trans('project.features_export_html'), [$project->id, 'html'], ['class' => 'btn btn-link','target' => '_blank']) !!}
{!! link_to_route('projects.features-export', trans('project.features_export_excel'), [$project->id], ['class' => 'btn btn-link']) !!}
{!! link_to_route('projects.features-export', trans('project.features_export_html'), [$project->id, 'html', 'feature_type' => Request::get('feature_type', 1)], ['class' => 'btn btn-link','target' => '_blank']) !!}
{!! link_to_route('projects.features-export', trans('project.features_export_excel'), [$project->id, 'excel', 'feature_type' => Request::get('feature_type', 1)], ['class' => 'btn btn-link']) !!}
</div>
@endif
<!-- Nav tabs -->
@ -9,11 +9,19 @@
<li class="{{ Request::segment(3) == null ? 'active' : '' }}">
{!! link_to_route('projects.show', trans('project.show'), [$project->id]) !!}
</li>
<li class="{{ Request::segment(3) == 'features' ? 'active' : '' }}">
<li class="{{ Request::segment(3) == 'features' && Request::has('feature_type') == false ? 'active' : '' }}">
{!! link_to_route('projects.features', trans('project.features') . ' (' . $project->features->count() . ')', [$project->id]) !!}
</li>
@if ($project->additionalFeatures->count())
<li class="{{ Request::segment(3) == 'features' && Request::has('feature_type') ? 'active' : '' }}">
{!! link_to_route('projects.features', trans('project.features') . ' Tambahan (' . $project->additionalFeatures->count() . ')', [$project->id, 'feature_type' => 2]) !!}
</li>
@endif
<li class="{{ Request::segment(3) == 'payments' ? 'active' : '' }}">
{!! link_to_route('projects.payments', trans('project.payments') . ' (' . $project->payments->count() . ')', [$project->id]) !!}
</li>
<li class="{{ Request::segment(3) == 'subscriptions' ? 'active' : '' }}">
{!! link_to_route('projects.subscriptions', trans('project.subscriptions'), [$project->id]) !!}
</li>
</ul>
<br>

43
resources/views/projects/subscriptions.blade.php

@ -0,0 +1,43 @@
@extends('layouts.app')
@section('title', trans('project.subscriptions'))
@section('content')
@include('projects.partials.breadcrumb',['title' => trans('project.subscriptions')])
<h1 class="page-header">
{!! link_to_route('subscriptions.create', trans('subscription.create'), ['project_id' => $project->id, 'customer_id' => $project->customer_id], ['class'=>'btn btn-success pull-right']) !!}
{{ $project->name }} <small>{{ trans('project.subscriptions') }}</small>
</h1>
@include('projects.partials.nav-tabs')
<table class="table table-condensed">
<thead>
<th>{{ trans('app.table_no') }}</th>
<th>{{ trans('subscription.domain_name') }}</th>
<th class="text-center">{{ trans('subscription.hosting_capacity') }}</th>
<th>{{ trans('subscription.start_date') }}</th>
<th>{{ trans('subscription.due_date') }}</th>
<th class="text-right">{{ trans('subscription.extension_price') }}</th>
<th>{{ trans('app.action') }}</th>
</thead>
<tbody>
@foreach($project->subscriptions as $key => $subscription)
<tr {{ Carbon::parse($subscription->due_date)->diffInDays(Carbon::now()) < 60 ? 'class=bg-danger' : '' }}>
<td>{{ 1 + $key }}</td>
<td>{{ $subscription->domain_name }}</td>
<td class="text-center">{{ $subscription->hosting_capacity }}</td>
<td>{{ dateId($subscription->start_date) }}</td>
<td>{{ dateId($subscription->due_date) }}</td>
<td class="text-right">{{ formatRp($subscription->domain_price + $subscription->hosting_price) }}</td>
<td>
{!! link_to_route('subscriptions.show',trans('app.show'),[$subscription->id],['class'=>'btn btn-info btn-xs']) !!}
{!! link_to_route('subscriptions.edit',trans('app.edit'),[$subscription->id],['class'=>'btn btn-warning btn-xs']) !!}
</td>
</tr>
@endforeach
</tbody>
</table>
@endsection

4
resources/views/subscriptions/create.blade.php

@ -39,8 +39,8 @@
{!! FormField::text('due_date',['label'=> trans('subscription.due_date')]) !!}
</div>
</div>
{!! FormField::select('customer_id', $customers,['label'=> trans('subscription.customer')]) !!}
{!! FormField::select('project_id', $projects,['label'=> trans('subscription.project')]) !!}
{!! FormField::select('customer_id', $customers,['label'=> trans('subscription.customer'),'value' => Request::get('customer_id')]) !!}
{!! FormField::select('project_id', $projects,['label'=> trans('subscription.project'),'value' => Request::get('project_id')]) !!}
{!! FormField::textarea('remark',['label'=> trans('subscription.remark')]) !!}
</div>

1
resources/views/subscriptions/edit.blade.php

@ -36,6 +36,7 @@
</div>
{!! FormField::select('customer_id', $customers,['label'=> trans('subscription.customer')]) !!}
{!! FormField::select('project_id', $projects,['label'=> trans('subscription.project')]) !!}
{!! FormField::radios('status_id', ['Non Active','Active'],['label'=> trans('app.status')]) !!}
{!! FormField::textarea('remark',['label'=> trans('subscription.remark')]) !!}
</div>

3
resources/views/subscriptions/index.blade.php

@ -14,6 +14,7 @@
{!! link_to_route('subscriptions.index','Reset',[],['class' => 'btn btn-default btn-sm']) !!}
{!! Form::close() !!}
</div>
<table class="table table-condensed">
<thead>
<th>{{ trans('app.table_no') }}</th>
@ -22,6 +23,7 @@
<th>{{ trans('subscription.start_date') }}</th>
<th>{{ trans('subscription.due_date') }}</th>
<th class="text-right">{{ trans('subscription.extension_price') }}</th>
<th class="text-center">{{ trans('app.status') }}</th>
<th>{{ trans('app.action') }}</th>
</thead>
<tbody>
@ -33,6 +35,7 @@
<td>{{ dateId($subscription->start_date) }}</td>
<td>{{ dateId($subscription->due_date) }}</td>
<td class="text-right">{{ formatRp($subscription->domain_price + $subscription->hosting_price) }}</td>
<td class="text-center">{{ $subscription->status() }}</td>
<td>
{!! link_to_route('subscriptions.show',trans('app.show'),[$subscription->id],['class'=>'btn btn-info btn-xs']) !!}
{!! link_to_route('subscriptions.edit',trans('app.edit'),[$subscription->id],['class'=>'btn btn-warning btn-xs']) !!}

16
tests/ManageFeaturesTest.php

@ -99,8 +99,13 @@ class ManageFeaturesTest extends TestCase
'project_id' => $project->id,
]);
$this->visit('projects/' . $feature->project_id . '/features');
$this->click(trans('app.show'));
// $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->click(trans('app.edit'));
$this->click(trans('feature.delete'));
$this->press(trans('app.delete_confirm_button'));
@ -126,10 +131,10 @@ class ManageFeaturesTest extends TestCase
$this->actingAs($user);
$project = factory(Project::class)->create(['owner_id' => $user->id]);
$feature = factory(Feature::class)->create(['project_id' => $project->id]);
$feature = factory(Feature::class)->create(['project_id' => $project->id,'type_id' => 1]);
$this->visit('projects/' . $project->id . '/features');
$this->click(trans('app.show'));
$this->click('show-feature-' . $feature->id);
$this->seePageIs('features/' . $feature->id);
$this->see(trans('feature.show'));
$this->see($feature->name);
@ -145,12 +150,11 @@ class ManageFeaturesTest extends TestCase
$this->actingAs($user);
$project = factory(Project::class)->create(['owner_id' => $user->id]);
$features = factory(Feature::class, 5)->create(['project_id' => $project->id]);
$features = factory(Feature::class, 5)->create(['project_id' => $project->id, 'type_id' => 1]);
$this->assertEquals(5, $features->count());
$this->visit('projects/' . $project->id . '/features');
$this->see($features[1]->name);
$this->see($features[1]->worker->name);
$this->see(formatRp($features[1]->price));
}

1
tests/ManagePaymentsTest.php

@ -156,7 +156,6 @@ class ManagePaymentsTest extends TestCase
$this->see($payments[4]->project->name);
$this->see($payments[4]->date);
$this->see(formatRp($payments[4]->amount));
$this->see($payments[4]->description);
$this->see($payments[4]->customer->name);
}

10
tests/ManageSubscriptionsTest.php

@ -44,7 +44,13 @@ class ManageSubscriptionsTest extends TestCase
$this->seePageIs('subscriptions');
$this->see(trans('subscription.created'));
$this->seeInDatabase('subscriptions', ['project_id' => $project->id,'domain_price' => 100000,'start_date' => '2015-05-02','due_date' => '2016-05-02']);
$this->seeInDatabase('subscriptions', [
'project_id' => $project->id,
'domain_price' => 100000,
'status_id' => 1,
'start_date' => '2015-05-02',
'due_date' => '2016-05-02'
]);
}
/** @test */
@ -70,6 +76,7 @@ class ManageSubscriptionsTest extends TestCase
$this->type(500000,'hosting_price');
$this->type('2015-05-02','start_date');
$this->type('2016-05-02','due_date');
$this->select(0,'status_id');
$this->press(trans('subscription.update'));
$this->seePageIs('subscriptions/' . $subscription->id . '/edit');
@ -78,6 +85,7 @@ class ManageSubscriptionsTest extends TestCase
'epp_code' => $eppCode,
'customer_id' => $customer->id,
'project_id' => $project->id,
'status_id' => 0,
'hosting_capacity' => '4GB',
'hosting_price' => '500000',
'start_date' => '2015-05-02',

4
tests/ManageTasksTest.php

@ -62,7 +62,6 @@ class ManageTasksTest extends TestCase
// Fill Form
$this->type('Nama Task Edit','name');
$this->type('tasks/{id}/edit','route_name');
$this->type(77,'progress');
$this->press(trans('task.update'));
@ -71,8 +70,7 @@ class ManageTasksTest extends TestCase
$this->seeInDatabase('tasks', [
'name' => 'Nama Task Edit',
'progress' => 77,
'feature_id' => $feature->id,
'route_name' => 'tasks/{id}/edit',
'feature_id' => $feature->id
]);
}

Loading…
Cancel
Save