40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
class OrderBugsTest extends DatabaseTestCase
|
|
{
|
|
use \KupShop\DevelopmentBundle\Util\Tests\CartTestTrait;
|
|
|
|
public function testBug6320()
|
|
{
|
|
global $dbcfg;
|
|
$dbcfg->currencies['CZK']['value'] = 1;
|
|
|
|
$user = User::createFromId(2);
|
|
$this->getContextManager()->activateUser($user, function () {
|
|
$this->createCart();
|
|
|
|
$this->cart->createFromDB();
|
|
$this->cart->delivery['name'] = 'test';
|
|
$this->cart->delivery['surname'] = 'test';
|
|
$this->cart->delivery['firm'] = null; // Caused delivery_firm cannot be null in INSERT
|
|
unset($this->cart->delivery['city']); // Caused undefined index in submitOrder
|
|
|
|
$this->assertInstanceOf('Order', $this->cart->submitOrder());
|
|
});
|
|
}
|
|
|
|
public function testChangeDeliveryInEurOrder()
|
|
{
|
|
$order = new Order();
|
|
$order->createFromDB(115700);
|
|
|
|
$order->changeDeliveryType(3);
|
|
$this->assertEquals('16.85', $order->total_price->asFloat());
|
|
}
|
|
|
|
public function getDataSet()
|
|
{
|
|
return $this->getJsonDataSetFromFile();
|
|
}
|
|
}
|