Server : Apache System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 User : vapecompany ( 2719) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vapecompany/demo.vapecompany.com.bd/vendor/bumbummen99/shoppingcart/tests/ |
Upload File : |
<?php namespace Gloudemans\Tests\Shoppingcart; use Gloudemans\Shoppingcart\Cart; use PHPUnit\Framework\Assert as PHPUnit; trait CartAssertions { /** * Assert that the cart contains the given number of items. * * @param int|float $items * @param \Gloudemans\Shoppingcart\Cart $cart */ public function assertItemsInCart($items, Cart $cart) { $actual = $cart->count(); PHPUnit::assertEquals($items, $cart->count(), "Expected the cart to contain {$items} items, but got {$actual}."); } /** * Assert that the cart contains the given number of rows. * * @param int $rows * @param \Gloudemans\Shoppingcart\Cart $cart */ public function assertRowsInCart($rows, Cart $cart) { $actual = $cart->content()->count(); PHPUnit::assertCount($rows, $cart->content(), "Expected the cart to contain {$rows} rows, but got {$actual}."); } }