Commit eadec7e1 authored by Thorsten Buss's avatar Thorsten Buss

replace deprecated assertCount

parent 8bae3bee
......@@ -372,12 +372,12 @@ class CartConditionTest extends PHPUnit_Framework_TestCase {
$this->cart->add($item);
// let's prove first we have 1 condition on this item
$this->assertCount(1, $this->cart->get($item['id'])['conditions'], "Item should have 1 condition");
$this->assertEquals(1, count($this->cart->get($item['id'])['conditions']), "Item should have 1 condition");
// now let's insert a condition on an existing item on the cart
$this->cart->addItemCondition($item['id'], $coupon101);
$this->assertCount(2, $this->cart->get($item['id'])['conditions'], "Item should have 2 conditions");
$this->assertEquals(2, count($this->cart->get($item['id'])['conditions']), "Item should have 2 conditions");
}
public function test_add_item_condition_restrict_negative_price() {
......@@ -504,13 +504,13 @@ class CartConditionTest extends PHPUnit_Framework_TestCase {
$this->cart->add($item);
// let's very first the item has 2 conditions in it
$this->assertCount(2, $this->cart->get(456)['conditions'], 'Item should have two conditions');
$this->assertEquals(2, count($this->cart->get(456)['conditions']), 'Item should have two conditions');
// now let's remove a condition on that item using the condition name
$this->cart->removeItemCondition(456, 'SALE 5%');
// now we should have only 1 condition left on that item
$this->assertCount(1, $this->cart->get(456)['conditions'], 'Item should have one condition left');
$this->assertEquals(1, count($this->cart->get(456)['conditions']), 'Item should have one condition left');
}
public function test_remove_item_condition_by_condition_name_scenario_two() {
......@@ -570,13 +570,13 @@ class CartConditionTest extends PHPUnit_Framework_TestCase {
$this->cart->add($item);
// let's very first the item has 2 conditions in it
$this->assertCount(2, $this->cart->get(456)['conditions'], 'Item should have two conditions');
$this->assertEquals(2, count($this->cart->get(456)['conditions']), 'Item should have two conditions');
// now let's remove all condition on that item
$this->cart->clearItemConditions(456);
// now we should have only 0 condition left on that item
$this->assertCount(0, $this->cart->get(456)['conditions'], 'Item should have no conditions now');
$this->assertEquals(0, count($this->cart->get(456)['conditions']), 'Item should have no conditions now');
}
public function test_clear_cart_conditions() {
......
......@@ -61,7 +61,7 @@ class CartTest extends PHPUnit_Framework_TestCase {
}
public function test_cart_can_add_items_with_multidimensional_array() {
$this->assertCount(0, $this->cart->items()->toArray(), 'Cart should have 0 items');
$this->assertEquals(0, count($this->cart->items()->toArray()), 'Cart should have 0 items');
$items = array(
array(
'id' => 456,
......@@ -89,7 +89,7 @@ class CartTest extends PHPUnit_Framework_TestCase {
$this->cart->add($items);
$this->assertFalse($this->cart->isEmpty(), 'Cart should not be empty');
$this->assertCount(3, $this->cart->items()->toArray(), 'Cart should have 3 items');
$this->assertEquals(3, count($this->cart->items()->toArray()), 'Cart should have 3 items');
}
public function test_cart_can_add_item_without_attributes() {
......@@ -155,7 +155,7 @@ class CartTest extends PHPUnit_Framework_TestCase {
$this->cart->add($item);
$this->assertFalse($this->cart->isEmpty(), 'Cart should not be empty');
$this->assertCount(2, $this->cart->items()->first()['attributes'], 'Item\'s attribute should have two');
$this->assertEquals(2, count($this->cart->items()->first()['attributes']), 'Item\'s attribute should have two');
$this->assertEquals('L', $this->cart->items()->first()->attributes->size, 'Item should have attribute size of L');
$this->assertEquals('blue', $this->cart->items()->first()->attributes->color, 'Item should have attribute color of blue');
$this->assertTrue($this->cart->get(456)->has('attributes'), 'Item should have attributes');
......@@ -268,7 +268,7 @@ class CartTest extends PHPUnit_Framework_TestCase {
$this->cart->remove($removeItemId);
$this->assertCount(2, $this->cart->items()->toArray(), 'Cart must have 2 items left');
$this->assertEquals(2, count($this->cart->items()->toArray()), 'Cart must have 2 items left');
$this->assertFalse($this->cart->items()->has($removeItemId), 'Cart must have not contain the remove item anymore');
}
......
......@@ -75,7 +75,7 @@ class CartTestMultipleInstances extends PHPUnit_Framework_TestCase {
$this->cart1->add($itemsForCart1);
$this->assertFalse($this->cart1->isEmpty(), 'Cart should not be empty');
$this->assertCount(3, $this->cart1->items()->toArray(), 'Cart should have 3 items');
$this->assertEquals(3, count($this->cart1->items()->toArray()), 'Cart should have 3 items');
$this->assertEquals('shopping', $this->cart1->getInstanceName(), 'Cart 1 should have instance name of "shopping"');
// add 1 item on cart 2
......@@ -92,7 +92,7 @@ class CartTestMultipleInstances extends PHPUnit_Framework_TestCase {
$this->cart2->add($itemsForCart2);
$this->assertFalse($this->cart2->isEmpty(), 'Cart should not be empty');
$this->assertCount(1, $this->cart2->items()->toArray(), 'Cart should have 3 items');
$this->assertEquals(1, count($this->cart2->items()->toArray()), 'Cart should have 3 items');
$this->assertEquals('wishlist', $this->cart2->getInstanceName(), 'Cart 2 should have instance name of "wishlist"');
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment