From 27bafb5d6d1c0de89b84868e5a2b4dff8be3af44 Mon Sep 17 00:00:00 2001 From: ykxiao Date: Thu, 7 Sep 2023 15:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A0=E5=B7=A5=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E5=88=9B=E5=BB=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phpunit.result.cache | 2 +- src/OrderActions/Order.php | 12 ++++++++++++ tests/Feature/OrderTest.php | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 5b09eef..ee233e9 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"Feature\\OrderTest::testGetProductOrder":5},"times":{"Unit\\OrderTest::testGetWeatherWithInvalidType":0.041,"Feature\\OrderTest::testGetWeatherWithInvalidType":0.026,"Unit\\OrderTest::testGetWeatherWithInvalidFormat":0,"Feature\\OrderTest::testGetWeatherWithInvalidFormat":0,"Feature\\OrderTest::testGetWeatherWithGuzzleRuntimeException":0.074,"Feature\\OrderTest::testGetHttpClient":0.015,"Feature\\OrderTest::testSetGuzzleOptions":0.002,"Unit\\OrderTest::testGetWeatherWithGuzzleRuntimeException":0.101,"Unit\\OrderTest::testGetHttpClient":0.02,"Unit\\OrderTest::testSetGuzzleOptions":0.004,"Feature\\OrderTest::testGetProductOrder":0.202}} \ No newline at end of file +{"version":1,"defects":{"Feature\\OrderTest::testGetProductOrder":5},"times":{"Unit\\OrderTest::testGetWeatherWithInvalidType":0.041,"Feature\\OrderTest::testGetWeatherWithInvalidType":0.107,"Unit\\OrderTest::testGetWeatherWithInvalidFormat":0,"Feature\\OrderTest::testGetWeatherWithInvalidFormat":0,"Feature\\OrderTest::testGetWeatherWithGuzzleRuntimeException":0.217,"Feature\\OrderTest::testGetHttpClient":0.043,"Feature\\OrderTest::testSetGuzzleOptions":0.01,"Unit\\OrderTest::testGetWeatherWithGuzzleRuntimeException":0.101,"Unit\\OrderTest::testGetHttpClient":0.02,"Unit\\OrderTest::testSetGuzzleOptions":0.004,"Feature\\OrderTest::testGetProductOrder":0.491,"Feature\\OrderTest::testCreateProductOrder":0.146}} \ No newline at end of file diff --git a/src/OrderActions/Order.php b/src/OrderActions/Order.php index 5e49f3e..5ac38b2 100644 --- a/src/OrderActions/Order.php +++ b/src/OrderActions/Order.php @@ -114,4 +114,16 @@ class Order ]; return $this->baseFun($data, 'production.status'); } + + /** + * 加工工单创建 + * @return mixed|string + * @throws GuzzleException + * @throws HttpException + * @throws InvalidArgumentException + */ + public function createProductOrder($data) + { + return $this->baseFun($data, 'production.create'); + } } diff --git a/tests/Feature/OrderTest.php b/tests/Feature/OrderTest.php index a1a9897..305a374 100644 --- a/tests/Feature/OrderTest.php +++ b/tests/Feature/OrderTest.php @@ -87,4 +87,16 @@ class OrderTest extends TestCase $w->getProductOrder('SN23454324565432'); $this->assertInstanceOf(ClientInterface::class, $w->getHttpClient()); } + + public function testCreateProductOrder() + { + $w = new Order('mock-key'); + + $data = [ + 'cube_plan' => 32.12, + 'owner' => 'ykxiao' + ]; + $w->createProductOrder($data); + $this->assertInstanceOf(ClientInterface::class, $w->getHttpClient()); + } }