本文整理汇总了PHP中TestHelperMShop类的典型用法代码示例。如果您正苦于以下问题:PHP TestHelperMShop类的具体用法?PHP TestHelperMShop怎么用?PHP TestHelperMShop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestHelperMShop类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
$this->editor = \TestHelperMShop::getContext()->getEditor();
$this->context = \TestHelperMShop::getContext();
$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($this->context);
$this->object = $orderManager->getSubManager('base')->getSubManager('address');
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:7,代码来源:StandardTest.php
示例2: testSaveUpdateDeleteItem
public function testSaveUpdateDeleteItem()
{
// insert case
$item = $this->object->createItem();
$item->setLabel('new name');
$item->setStatus(1);
$item->setCode('xx');
$this->object->saveItem($item);
$itemSaved = $this->object->getItem($item->getId());
// update case
$itemExp = clone $itemSaved;
$itemExp->setLabel('new new name');
$this->object->saveItem($itemExp);
$itemUpd = $this->object->getItem($itemExp->getId());
$this->object->deleteItem($item->getId());
$context = \TestHelperMShop::getContext();
$this->assertTrue($item->getId() !== null);
$this->assertEquals($item->getId(), $itemSaved->getId());
$this->assertEquals($item->getLabel(), $itemSaved->getLabel());
$this->assertEquals($item->getStatus(), $itemSaved->getStatus());
$this->assertEquals($item->getCode(), $itemSaved->getCode());
$this->assertEquals($context->getEditor(), $itemSaved->getEditor());
$this->assertRegExp('/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/', $itemSaved->getTimeCreated());
$this->assertRegExp('/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/', $itemSaved->getTimeModified());
$this->assertEquals($itemExp->getId(), $itemUpd->getId());
$this->assertEquals($itemExp->getStatus(), $itemUpd->getStatus());
$this->assertEquals($itemExp->getCode(), $itemUpd->getCode());
$this->assertEquals($itemExp->getLabel(), $itemUpd->getLabel());
$this->assertEquals($context->getEditor(), $itemUpd->getEditor());
$this->assertEquals($itemExp->getTimeCreated(), $itemUpd->getTimeCreated());
$this->assertRegExp('/\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/', $itemUpd->getTimeModified());
$this->setExpectedException('\\Aimeos\\MShop\\Exception');
$this->object->getItem($item->getId());
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:34,代码来源:StandardTest.php
示例3: setUp
protected function setUp()
{
$manager = \Aimeos\MShop\Locale\Manager\Factory::createManager(\TestHelperMShop::getContext());
$this->siteItem = $manager->getSubManager('site')->createItem();
$this->values = array('locale.id' => 1, 'locale.siteid' => 1, 'locale.languageid' => 'de', 'locale.currencyid' => 'EUR', 'locale.position' => 1, 'locale.status' => 1, 'locale.mtime' => '2011-01-01 00:00:02', 'locale.ctime' => '2011-01-01 00:00:01', 'locale.editor' => 'unitTestUser');
$this->object = new \Aimeos\MShop\Locale\Item\Standard($this->values, $this->siteItem, array(1, 2), array(1, 3, 4));
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:7,代码来源:StandardTest.php
示例4: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->context = \TestHelperMShop::getContext();
$this->editor = $this->context->getEditor();
$manager = \Aimeos\MShop\Price\Manager\Factory::createManager($this->context, 'Standard');
$this->object = $manager->getSubManager('lists', 'Standard');
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:13,代码来源:StandardTest.php
示例5: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->editor = \TestHelperMShop::getContext()->getEditor();
$attributeManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager(\TestHelperMShop::getContext());
$attributeListManager = $attributeManager->getSubManager('lists');
$this->object = $attributeListManager->getSubManager('type');
}
开发者ID:nos3,项目名称:aimeos-core,代码行数:13,代码来源:StandardTest.php
示例6: setUp
/**
* Sets up the fixture. This method is called before a test is executed.
*/
protected function setUp()
{
$this->editor = \TestHelperMShop::getContext()->getEditor();
$this->object = new \Aimeos\MShop\Customer\Manager\Standard(\TestHelperMShop::getContext());
$this->fixture = array('customer.label' => 'unitTest', 'customer.status' => 2);
$this->address = new \Aimeos\MShop\Common\Item\Address\Standard('customer.');
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:10,代码来源:StandardTest.php
示例7: setUp
/**
* Sets up the fixture, especially creates products.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$orderProducts = array();
$context = \TestHelperMShop::getContext();
$this->couponItem = \Aimeos\MShop\Coupon\Manager\Factory::createManager($context)->createItem();
$provider = new \Aimeos\MShop\Coupon\Provider\Example($context, $this->couponItem, 'abcd');
$this->object = new \Aimeos\MShop\Coupon\Provider\Decorator\Required($provider, $context, $this->couponItem, 'abcd');
$this->object->setObject($this->object);
$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager($context);
$orderBaseManager = $orderManager->getSubManager('base');
$orderProductManager = $orderBaseManager->getSubManager('product');
$productManager = \Aimeos\MShop\Product\Manager\Factory::createManager($context);
$search = $productManager->createSearch();
$search->setConditions($search->compare('==', 'product.code', array('CNC')));
$products = $productManager->searchItems($search);
$priceManager = \Aimeos\MShop\Price\Manager\Factory::createManager($context);
$price = $priceManager->createItem();
$price->setValue(321);
foreach ($products as $product) {
$orderProduct = $orderProductManager->createItem();
$orderProduct->copyFrom($product);
$orderProducts[$product->getCode()] = $orderProduct;
}
$orderProducts['CNC']->setPrice($price);
$this->orderBase = new \Aimeos\MShop\Order\Item\Base\Standard($priceManager->createItem(), $context->getLocale());
$this->orderBase->addProduct($orderProducts['CNC']);
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:33,代码来源:RequiredTest.php
示例8: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperMShop::getContext());
$orderBaseManager = $orderManager->getSubManager('base');
$this->order = $orderBaseManager->createItem();
$orderBaseProductManager = $orderBaseManager->getSubManager('product');
$search = $orderBaseProductManager->createSearch();
$search->setConditions($search->combine('&&', array($search->compare('==', 'order.base.product.prodcode', array('CNE', 'CNC')), $search->compare('==', 'order.base.product.price', array('600.00', '36.00')))));
$items = $orderBaseProductManager->searchItems($search);
if (count($items) < 2) {
throw new \Exception('Please fix the test data in your database.');
}
foreach ($items as $item) {
$this->products[$item->getProductCode()] = $item;
}
$this->products['CNE']->setQuantity(2);
$this->products['CNC']->setQuantity(1);
$config = array('min-value' => array('EUR' => '75.00'), 'max-value' => array('EUR' => '625.00'), 'min-products' => '2', 'max-products' => 5);
$pluginManager = \Aimeos\MShop\Plugin\Manager\Factory::createManager(\TestHelperMShop::getContext());
$plugin = $pluginManager->createItem();
$plugin->setTypeId(2);
$plugin->setProvider('BasketLimits');
$plugin->setConfig($config);
$plugin->setStatus('1');
$this->object = new \Aimeos\MShop\Plugin\Provider\Order\BasketLimits(\TestHelperMShop::getContext(), $plugin);
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:32,代码来源:BasketLimitsTest.php
示例9: setUp
/**
* Sets up the fixture.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->editor = \TestHelperMShop::getContext()->getEditor();
$manager = \Aimeos\MShop\Service\Manager\Factory::createManager(\TestHelperMShop::getContext());
$listManager = $manager->getSubManager('lists');
$this->object = $listManager->getSubManager('type');
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:13,代码来源:StandardTest.php
示例10: setUp
protected function setUp()
{
$this->context = \TestHelperMShop::getContext('unitperf');
// parser warm up so files are already parsed (same as APC is used)
$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context);
$this->root = $catalogManager->getTree(null, array('text', 'media'), \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE);
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:7,代码来源:CatalogTest.php
示例11: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->context = \TestHelperMShop::getContext();
$config = $this->context->getConfig();
$config->set('mshop/common/manager/decorators/default', array());
$config->set('mshop/attribute/manager/decorators/global', array());
$config->set('mshop/attribute/manager/decorators/local', array());
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:14,代码来源:BaseTest.php
示例12: testSetLocale
public function testSetLocale()
{
$locale = \Aimeos\MShop\Locale\Manager\Factory::createManager(\TestHelperMShop::getContext())->createItem();
$return = $this->object->setLocale($locale);
$this->assertInstanceOf('\\Aimeos\\MShop\\Order\\Item\\Base\\Iface', $return);
$this->assertEquals($locale, $this->object->getLocale());
$this->assertTrue($this->object->isModified());
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:8,代码来源:StandardTest.php
示例13: testUpdateSync
public function testUpdateSync()
{
$manager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperMShop::getContext());
$order = $manager->createItem();
$this->object->expects($this->once())->method('getOrder')->will($this->returnValue($order));
$this->object->updateSync(array('orderid' => -1));
$this->assertEquals(\Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED, $order->getPaymentStatus());
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:8,代码来源:PostPayTest.php
示例14: setUp
protected function setUp()
{
$context = \TestHelperMShop::getContext();
$dbm = $context->getDatabaseManager();
$conn = $dbm->acquire();
$this->object = new \Aimeos\MW\Criteria\MySQL($conn);
$dbm->release($conn);
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:8,代码来源:MySQLTest.php
示例15: setUp
protected function setUp()
{
$this->context = \TestHelperMShop::getContext();
$servManager = \Aimeos\MShop\Service\Manager\Factory::createManager($this->context);
$this->servItem = $servManager->createItem();
$this->mockProvider = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Decorator\\Example')->disableOriginalConstructor()->getMock();
$this->object = new \Aimeos\MShop\Service\Provider\Decorator\Weight($this->mockProvider, $this->context, $this->servItem);
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:8,代码来源:WeightTest.php
示例16: testAddCouponInvalidConfig
public function testAddCouponInvalidConfig()
{
$context = \TestHelperMShop::getContext();
$couponItem = \Aimeos\MShop\Coupon\Manager\Factory::createManager(\TestHelperMShop::getContext())->createItem();
$object = new \Aimeos\MShop\Coupon\Provider\FreeShipping($context, $couponItem, 'zyxw');
$this->setExpectedException('\\Aimeos\\MShop\\Coupon\\Exception');
$object->addCoupon($this->orderBase);
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:8,代码来源:FreeShippingTest.php
示例17: setUp
protected function setUp()
{
$this->context = \TestHelperMShop::getContext();
$servManager = \Aimeos\MShop\Factory::createManager($this->context, 'service');
$this->servItem = $servManager->createItem();
$this->mockProvider = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Decorator\\Currency')->disableOriginalConstructor()->getMock();
$this->basket = \Aimeos\MShop\Order\Manager\Factory::createManager($this->context)->getSubManager('base')->createItem();
$this->object = new \Aimeos\MShop\Service\Provider\Decorator\Currency($this->mockProvider, $this->context, $this->servItem);
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:9,代码来源:CurrencyTest.php
示例18: setUp
protected function setUp()
{
$context = \TestHelperMShop::getContext();
$priceManager = \Aimeos\MShop\Price\Manager\Factory::createManager($context);
$item = \Aimeos\MShop\Coupon\Manager\Factory::createManager($context)->createItem();
// Don't create order base item by createItem() as this would already register the plugins
$this->orderBase = new \Aimeos\MShop\Order\Item\Base\Standard($priceManager->createItem(), $context->getLocale());
$this->object = new \Aimeos\MShop\Coupon\Provider\None($context, $item, '1234');
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:9,代码来源:NoneTest.php
示例19: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$context = \TestHelperMShop::getContext();
$pluginManager = \Aimeos\MShop\Plugin\Manager\Factory::createManager($context);
$item = $pluginManager->createItem();
$provider = new \Aimeos\MShop\Plugin\Provider\Order\Example($context, $item);
$priceItem = \Aimeos\MShop\Price\Manager\Factory::createManager($context)->createItem();
$this->order = new \Aimeos\MShop\Order\Item\Base\Standard($priceItem, $context->getLocale());
$this->object = new \Aimeos\MShop\Plugin\Provider\Decorator\Log($context, $item, $provider);
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:16,代码来源:LogTest.php
示例20: setUp
protected function setUp()
{
$context = clone \TestHelperMShop::getContext();
$config = $context->getConfig();
$dbadapter = $config->get('resource/db-index/adapter', $config->get('resource/db/adapter'));
if ($dbadapter !== 'pgsql') {
$this->markTestSkipped('PostgreSQL specific test');
}
$this->object = new \Aimeos\MShop\Index\Manager\Text\PgSQL(\TestHelperMShop::getContext());
}
开发者ID:aimeos,项目名称:aimeos-core,代码行数:10,代码来源:PgSQLTest.php
注:本文中的TestHelperMShop类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论