mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
Adjusted for global discount
Fixed tests for Laravel 5.7
This commit is contained in:
@@ -37,6 +37,7 @@ class CartItemTest extends TestCase
|
||||
],
|
||||
'tax' => 0,
|
||||
'subtotal' => 20.00,
|
||||
'discount' => 0.0
|
||||
], $cartItem->toArray());
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@ class CartItemTest extends TestCase
|
||||
|
||||
$this->assertJson($cartItem->toJson());
|
||||
|
||||
$json = '{"rowId":"07d5da5550494c62daf9993cf954303f","id":1,"name":"Some item","qty":2,"price":10,"options":{"size":"XL","color":"red"},"tax":0,"subtotal":20}';
|
||||
$json = '{"rowId":"07d5da5550494c62daf9993cf954303f","id":1,"name":"Some item","qty":2,"price":10,"options":{"size":"XL","color":"red"},"discount":0,"tax":0,"subtotal":20}';
|
||||
|
||||
$this->assertEquals($json, $cartItem->toJson());
|
||||
}
|
||||
|
||||
@@ -488,6 +488,7 @@ class CartTest extends TestCase
|
||||
'tax' => 2.10,
|
||||
'subtotal' => 10.0,
|
||||
'options' => [],
|
||||
'discount' => 0.0
|
||||
],
|
||||
'370d08585360f5c568b18d1f2e4ca1df' => [
|
||||
'rowId' => '370d08585360f5c568b18d1f2e4ca1df',
|
||||
@@ -498,6 +499,7 @@ class CartTest extends TestCase
|
||||
'tax' => 2.10,
|
||||
'subtotal' => 10.0,
|
||||
'options' => [],
|
||||
'discount' => 0.0
|
||||
]
|
||||
], $content->toArray());
|
||||
}
|
||||
@@ -913,7 +915,7 @@ class CartTest extends TestCase
|
||||
|
||||
$user = Mockery::mock(Authenticatable::class);
|
||||
|
||||
event(new Logout($user));
|
||||
event(new Logout(\Auth::guard('web'), $user));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user