first commit
This commit is contained in:
39
tests/functional/BugsTest/OrderBugsTest.php
Normal file
39
tests/functional/BugsTest/OrderBugsTest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user