From f9b10811e3beb902db766cd054e87a3de397ef20 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sat, 25 May 2013 17:44:05 +0100 Subject: [PATCH] Parse stock modifiers -=+ --- test/textcartManagerTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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); -- 2.30.2