From: Maxime Bourget Date: Sat, 25 May 2013 16:44:05 +0000 (+0100) Subject: Parse stock modifiers -=+ X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=f9b10811e3beb902db766cd054e87a3de397ef20;p=textcart.git Parse stock modifiers -=+ --- diff --git a/test/textcartManagerTest.php b/test/textcartManagerTest.php index 0057c58..041ab9c 100644 --- a/test/textcartManagerTest.php +++ b/test/textcartManagerTest.php @@ -76,6 +76,22 @@ class TextcartManagerTest extends PHPUnit_Framework_TestCase { $this->assertParse($line, NORMAL_LINE, $stock_code, $quantity, $price, $discount, $description, $date); } + public function parseAdvanced() { + return array( + array("A 10 ", NORMAL_LINE, "A", '10', null) + ,array("+A 10 ", INSERT_MODE, "A", '10', null) + ,array("=A 10 ", UPDATE_MODE, "A", '10', null) + ,array("-A 10 ", DELETE_MODE, "A", '10', null) + ); + } + + /** + * @dataProvider parseAdvanced + */ + public function testAdvanced($line, $mode, $stock_code, $quantity, $price, $discount=null, $description=null, $date=null) { + $this->assertParse($line, $mode, $stock_code, $quantity, $price, $discount, $description, $date); + } + public function assertParse($line, $mode, $stock_code, $quantity, $price, $discount=null, $description=null, $date=null) { $data = $this->mgr->parse_line($line);