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()); + } }