Browse Source

Apply fixes from StyleCI (#5)

pull/6/head
Nafies Luthfi 9 years ago
committed by GitHub
parent
commit
2a7a163de1
  1. 1
      app/Http/Controllers/ProductsController.php
  2. 2
      app/Http/Controllers/TransactionsController.php
  3. 1
      app/Transaction.php
  4. 1
      routes/api.php
  5. 4
      tests/Feature/TransactionEntryTest.php
  6. 16
      tests/TestCase.php

1
app/Http/Controllers/ProductsController.php

@ -83,6 +83,7 @@ class ProductsController extends Controller
public function priceList()
{
$products = Product::orderBy('name')->with('unit')->get();
return view('products.price-list', compact('products'));
// $pdf = PDF::loadView('products.price-list', compact('products'));

2
app/Http/Controllers/TransactionsController.php

@ -24,7 +24,7 @@ class TransactionsController extends Controller
{
// return view('transactions.pdf', compact('transaction'));
$pdf = PDF::loadView('transactions.pdf', compact('transaction'));
return $pdf->stream($transaction->invoice_no.'.faktur.pdf');
return $pdf->stream($transaction->invoice_no.'.faktur.pdf');
}
}

1
app/Transaction.php

@ -2,7 +2,6 @@
namespace App;
use App\User;
use Illuminate\Database\Eloquent\Model;
class Transaction extends Model

1
routes/api.php

@ -1,6 +1,5 @@
<?php
use Illuminate\Http\Request;
Route::group(['prefix' => 'v1', 'namespace' => 'Api', 'as' => 'api.', 'middleware' => []], function () {
Route::post('products/search', ['as' => 'products.search', 'uses' => 'ProductsController@search']);

4
tests/Feature/TransactionEntryTest.php

@ -92,14 +92,14 @@ class TransactionEntryTest extends BrowserKitTestCase
$this->press('add-product-'.$product1->id);
$this->see(trans('cart.item_added', [
'product_name' => $product1->name.' ('.$product1->unit->name.')',
'qty' => 2
'qty' => 2,
]));
$this->type(3, 'qty');
$this->press('add-product-'.$product2->id);
$this->see(trans('cart.item_added', [
'product_name' => $product2->name.' ('.$product2->unit->name.')',
'qty' => 3
'qty' => 3,
]));
$this->seePageIs(route('cart.show', [$draft->draftKey, 'query' => 'testing']));

16
tests/TestCase.php

@ -2,10 +2,10 @@
namespace Tests;
use App\User;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use App\Exceptions\Handler;
use App\User;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
@ -23,9 +23,15 @@ abstract class TestCase extends BaseTestCase
{
// Disable Laravel's default exception handling
// and allow exceptions to bubble up the stack
$this->app->instance(ExceptionHandler::class, new class extends Handler {
public function __construct() {}
public function report(\Exception $exception) {}
$this->app->instance(ExceptionHandler::class, new class() extends Handler {
public function __construct()
{
}
public function report(\Exception $exception)
{
}
public function render($request, \Exception $exception)
{
throw $exception;

Loading…
Cancel
Save