Fixes
This commit is contained in:
parent
5512f3bd60
commit
70d096f866
@ -102,3 +102,33 @@ PSC\Shop\EntityBundle\Entity\Product:
|
|||||||
|
|
||||||
</artikel>
|
</artikel>
|
||||||
</kalkulation>
|
</kalkulation>
|
||||||
|
product_6:
|
||||||
|
uid: 10
|
||||||
|
title: XML Calc Test Api Color Size
|
||||||
|
language: 'de'
|
||||||
|
url: xml_test_10
|
||||||
|
uuid: 01938686-0e4d-7da9-bae3-b2e1b1681f7f
|
||||||
|
type: 6
|
||||||
|
pos: <numberBetween(1, 200)>
|
||||||
|
notEdit: false
|
||||||
|
private: false
|
||||||
|
taxClass: 19
|
||||||
|
set_config: '{}'
|
||||||
|
shop: '@shop_1'
|
||||||
|
calcXml: >
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<kalkulation>
|
||||||
|
<artikel>
|
||||||
|
<name>COLORDB Test</name>
|
||||||
|
<kommentar>210 mm x 297 mm</kommentar>
|
||||||
|
|
||||||
|
<option id="auflage" name="Auflage" type="Input" default="10"/>
|
||||||
|
|
||||||
|
<option id="farbe_1" name="Farbe 1" type="Select" mode="colordb" container="hks-n" default="78" require="true"></option>
|
||||||
|
|
||||||
|
<option id="farbe_2" name="Farbe 2" type="Select" mode="colordb" container="pantone+-solid-uncoated" default="142" require="true"></option>
|
||||||
|
|
||||||
|
<option id="farbe_3" name="Farbe 3" type="Select" mode="colordb" container="hks-n" default="78" require="true"></option>
|
||||||
|
|
||||||
|
</artikel>
|
||||||
|
</kalkulation>
|
||||||
|
|||||||
@ -0,0 +1,113 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Plugins\System\PSC\XmlCalc\Api;
|
||||||
|
|
||||||
|
use PSC\Shop\ContactBundle\Model\AccountType;
|
||||||
|
use PSC\Shop\EntityBundle\Repository\JobRepository;
|
||||||
|
use Tests\RefreshDatabaseTrait;
|
||||||
|
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||||
|
use PSC\Shop\EntityBundle\Repository\ShopRepository;
|
||||||
|
use PSC\Shop\PaymentBundle\Repository\PaymentRepository;
|
||||||
|
use PSC\Shop\ShippingBundle\Repository\ShippingRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
|
class CreateOrderColorDBTest extends WebTestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
public function testCreateOrderContactPersonal(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$shopRepository = static::getContainer()->get(ShopRepository::class);
|
||||||
|
|
||||||
|
$shop = $shopRepository->findOneBy(['title' => 'Printchampion']);
|
||||||
|
|
||||||
|
$shippingRepository = static::getContainer()->get(ShippingRepository::class);
|
||||||
|
|
||||||
|
$paymentRepository = static::getContainer()->get(PaymentRepository::class);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/create',
|
||||||
|
[
|
||||||
|
'shop' => [
|
||||||
|
'uuid' => (string)$shop->getUuid()
|
||||||
|
],
|
||||||
|
'type' => 2,
|
||||||
|
'shipping' => [
|
||||||
|
'uid' => $shippingRepository->findOneBy(['title' => 'Abholung vor Ort'])->getUid()
|
||||||
|
],
|
||||||
|
'payment' => [
|
||||||
|
'uid' => $paymentRepository->findOneBy(['title' => 'Bar bei Abholung'])->getUid()
|
||||||
|
],
|
||||||
|
'draft' => false,
|
||||||
|
'deliveryAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17506',
|
||||||
|
'city' => 'Gribow'
|
||||||
|
],
|
||||||
|
'invoiceAddress' => [
|
||||||
|
'firstname' => 'Thomas',
|
||||||
|
'lastname' => 'Peterson',
|
||||||
|
'street' => 'Chausseestr.',
|
||||||
|
'houseNumber' => '24',
|
||||||
|
'zip' => '17400',
|
||||||
|
'city' => 'Berlin'
|
||||||
|
],
|
||||||
|
'positions' => [
|
||||||
|
[
|
||||||
|
'count' => 1,
|
||||||
|
'product' => [
|
||||||
|
'title' => 'test XML',
|
||||||
|
'specialProductTypeObject' => [
|
||||||
|
'typ' => 6,
|
||||||
|
'taxClass' => 1900,
|
||||||
|
'xml' => '<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<kalkulation>
|
||||||
|
<artikel>
|
||||||
|
<name>COLORDB Test</name>
|
||||||
|
<kommentar>210 mm x 297 mm</kommentar>
|
||||||
|
|
||||||
|
<option id="auflage" name="Auflage" type="Input" default="10"/>
|
||||||
|
|
||||||
|
<option id="farbe_1" name="Farbe 1" type="Select" mode="colordb" container="hks-n" default="78" require="true"></option>
|
||||||
|
|
||||||
|
<!-- <option id="farbe_2" name="Farbe 2" type="Select" mode="colordb" container="pantone+-solid-uncoated" default="142" require="true"></option>
|
||||||
|
|
||||||
|
<option id="farbe_3" name="Farbe 3" type="Select" mode="colordb" container="hks-n" default="78" require="true"></option>
|
||||||
|
-->
|
||||||
|
</artikel>
|
||||||
|
</kalkulation>'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'POST',
|
||||||
|
'/api/order/getonebyuuid',
|
||||||
|
[
|
||||||
|
'uuid' => $data['uuid'],
|
||||||
|
],
|
||||||
|
['HTTP_apiKey' => $shop->getApiKey()]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
|
||||||
|
self::assertSame(44006, strlen($client->getResponse()->getContent()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -62,7 +62,7 @@ class Position implements IPositionTransformer
|
|||||||
}
|
}
|
||||||
|
|
||||||
$articleCalc = $engine->getArticle();
|
$articleCalc = $engine->getArticle();
|
||||||
$obj->setEngine($engine);
|
//$obj->setEngine($engine);
|
||||||
if ($articleCalc) {
|
if ($articleCalc) {
|
||||||
$obj->setOptions($articleCalc->getOptions());
|
$obj->setOptions($articleCalc->getOptions());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user