本文整理汇总了PHP中TestHelperExtjs类的典型用法代码示例。如果您正苦于以下问题:PHP TestHelperExtjs类的具体用法?PHP TestHelperExtjs怎么用?PHP TestHelperExtjs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestHelperExtjs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSaveDeleteItem
public function testSaveDeleteItem()
{
$catalogManager = \Aimeos\MShop\Catalog\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$node = $catalogManager->getTree(null, array(), \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE);
$params = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('catalog.lists.type.domain' => 'product')))), 'start' => 0, 'limit' => 1);
$catalogListTypeManager = \Aimeos\Controller\ExtJS\Catalog\Lists\Type\Factory::createController(\TestHelperExtjs::getContext());
$resultType = $catalogListTypeManager->searchItems($params);
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('catalog.lists.parentid' => $node->getId(), 'catalog.lists.typeid' => $resultType['items'][0]->{'catalog.lists.type.id'}, 'catalog.lists.domain' => 'product', 'catalog.lists.refid' => -1, 'catalog.lists.datestart' => '2000-01-01 00:00:00', 'catalog.lists.dateend' => '2000-01-01 00:00:00', 'catalog.lists.config' => array('test' => 'unit'), 'catalog.lists.position' => 1, 'catalog.lists.status' => 1));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('catalog.lists.refid' => -1)))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'catalog.lists.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'catalog.lists.id'});
$this->assertEquals($saved['items']->{'catalog.lists.id'}, $searched['items'][0]->{'catalog.lists.id'});
$this->assertEquals($saved['items']->{'catalog.lists.parentid'}, $searched['items'][0]->{'catalog.lists.parentid'});
$this->assertEquals($saved['items']->{'catalog.lists.typeid'}, $searched['items'][0]->{'catalog.lists.typeid'});
$this->assertEquals($saved['items']->{'catalog.lists.domain'}, $searched['items'][0]->{'catalog.lists.domain'});
$this->assertEquals($saved['items']->{'catalog.lists.refid'}, $searched['items'][0]->{'catalog.lists.refid'});
$this->assertEquals($saved['items']->{'catalog.lists.datestart'}, $searched['items'][0]->{'catalog.lists.datestart'});
$this->assertEquals($saved['items']->{'catalog.lists.dateend'}, $searched['items'][0]->{'catalog.lists.dateend'});
$this->assertEquals($saved['items']->{'catalog.lists.config'}, $searched['items'][0]->{'catalog.lists.config'});
$this->assertEquals($saved['items']->{'catalog.lists.position'}, $searched['items'][0]->{'catalog.lists.position'});
$this->assertEquals($saved['items']->{'catalog.lists.status'}, $searched['items'][0]->{'catalog.lists.status'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例2: testSaveDeleteItem
public function testSaveDeleteItem()
{
$manager = \Aimeos\MShop\Attribute\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$typeManager = $manager->getSubManager('type');
$criteria = $typeManager->createSearch();
$criteria->setSlice(0, 1);
$result = $typeManager->searchItems($criteria);
if (($type = reset($result)) === false) {
throw new \Exception('No type item found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('attribute.typeid' => $type->getId(), 'attribute.domain' => 'product', 'attribute.code' => 'test', 'attribute.label' => 'test label', 'attribute.position' => 1, 'attribute.status' => 0));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => array('==' => (object) array('attribute.code' => 'test')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => array($saved['items']->{'attribute.id'}));
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'attribute.id'});
$this->assertEquals($saved['items']->{'attribute.id'}, $searched['items'][0]->{'attribute.id'});
$this->assertEquals($saved['items']->{'attribute.typeid'}, $searched['items'][0]->{'attribute.typeid'});
$this->assertEquals($saved['items']->{'attribute.domain'}, $searched['items'][0]->{'attribute.domain'});
$this->assertEquals($saved['items']->{'attribute.code'}, $searched['items'][0]->{'attribute.code'});
$this->assertEquals($saved['items']->{'attribute.label'}, $searched['items'][0]->{'attribute.label'});
$this->assertEquals($saved['items']->{'attribute.position'}, $searched['items'][0]->{'attribute.position'});
$this->assertEquals($saved['items']->{'attribute.status'}, $searched['items'][0]->{'attribute.status'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例3: testSaveItemLabelContent
public function testSaveItemLabelContent()
{
$typeManager = \Aimeos\MShop\Factory::createManager(\TestHelperExtjs::getContext(), 'text/type');
$criteria = $typeManager->createSearch();
$criteria->setSlice(0, 1);
$result = $typeManager->searchItems($criteria);
if (($type = reset($result)) === false) {
throw new \Exception('No type item found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('text.content' => 'controller test text', 'text.domain' => 'product', 'text.typeid' => $type->getId(), 'text.languageid' => 'de', 'text.status' => 1));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('text.content' => 'controller test text')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'text.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'text.id'});
$this->assertEquals($saved['items']->{'text.id'}, $searched['items'][0]->{'text.id'});
$this->assertEquals($saved['items']->{'text.content'}, $searched['items'][0]->{'text.content'});
$this->assertEquals($saved['items']->{'text.domain'}, $searched['items'][0]->{'text.domain'});
$this->assertEquals($saved['items']->{'text.typeid'}, $searched['items'][0]->{'text.typeid'});
$this->assertEquals($saved['items']->{'text.content'}, $searched['items'][0]->{'text.label'});
$this->assertEquals($saved['items']->{'text.languageid'}, $searched['items'][0]->{'text.languageid'});
$this->assertEquals($saved['items']->{'text.status'}, $searched['items'][0]->{'text.status'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
$this->assertEquals('controller test text', $saved['items']->{'text.label'});
}
示例4: testSaveDeleteItem
public function testSaveDeleteItem()
{
$couponManager = \Aimeos\MShop\Coupon\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$search = $couponManager->createSearch();
$search->setConditions($search->compare('==', 'coupon.label', 'Unit test example'));
$result = $couponManager->searchItems($search);
if (($couponItem = reset($result)) === false) {
throw new \Exception('No coupon item found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('coupon.code.parentid' => $couponItem->getId(), 'coupon.code.code' => 'zzzz', 'coupon.code.count' => -1));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => array('==' => (object) array('coupon.code.code' => 'zzzz')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => array($saved['items']->{'coupon.code.id'}));
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'coupon.code.id'});
$this->assertEquals($saved['items']->{'coupon.code.parentid'}, $searched['items'][0]->{'coupon.code.parentid'});
$this->assertEquals($saved['items']->{'coupon.code.code'}, $searched['items'][0]->{'coupon.code.code'});
$this->assertEquals($saved['items']->{'coupon.code.count'}, $searched['items'][0]->{'coupon.code.count'});
$this->assertEquals($saved['items']->{'coupon.code.datestart'}, $searched['items'][0]->{'coupon.code.datestart'});
$this->assertEquals($saved['items']->{'coupon.code.dateend'}, $searched['items'][0]->{'coupon.code.dateend'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例5: testSaveDeleteItem
public function testSaveDeleteItem()
{
$manager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$baseManager = $manager->getSubManager('base');
$search = $baseManager->createSearch();
$search->setConditions($search->compare('==', 'order.base.price', '53.50'));
$results = $baseManager->searchItems($search);
if (($expected = reset($results)) === false) {
throw new \RuntimeException('No base item found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('order.base.product.id' => null, 'order.base.product.baseid' => $expected->getId(), 'order.base.product.type' => 'default', 'order.base.product.suppliercode' => 'unitsupplier', 'order.base.product.prodcode' => 'EFGH22', 'order.base.product.name' => 'FoooBar', 'order.base.product.quantity' => 5, 'order.base.product.flags' => 0, 'order.base.product.status' => 1, 'order.base.product.position' => 5));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => array('==' => (object) array('order.base.product.name' => 'FoooBar')), 1 => array('==' => (object) array('order.base.product.prodcode' => 'EFGH22')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'order.base.product.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'order.base.product.id'});
$this->assertEquals($saved['items']->{'order.base.product.id'}, $searched['items'][0]->{'order.base.product.id'});
$this->assertEquals($saved['items']->{'order.base.product.baseid'}, $searched['items'][0]->{'order.base.product.baseid'});
$this->assertEquals($saved['items']->{'order.base.product.suppliercode'}, $searched['items'][0]->{'order.base.product.suppliercode'});
$this->assertEquals($saved['items']->{'order.base.product.prodcode'}, $searched['items'][0]->{'order.base.product.prodcode'});
$this->assertEquals($saved['items']->{'order.base.product.name'}, $searched['items'][0]->{'order.base.product.name'});
$this->assertEquals($saved['items']->{'order.base.product.quantity'}, $searched['items'][0]->{'order.base.product.quantity'});
$this->assertEquals($saved['items']->{'order.base.product.flags'}, $searched['items'][0]->{'order.base.product.flags'});
$this->assertEquals($saved['items']->{'order.base.product.status'}, $searched['items'][0]->{'order.base.product.status'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例6: 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->object = new \Aimeos\Controller\ExtJS\Catalog\Standard(\TestHelperExtjs::getContext());
$params = (object) array('site' => 'unittest', 'items' => 'root');
$result = $this->object->getTree($params);
$this->rootnode = $result['items'];
}
示例7: testSaveDeleteItem
public function testSaveDeleteItem()
{
$params = (object) array('site' => 'unittest', 'limit' => 1);
$textManager = new \Aimeos\Controller\ExtJS\Text\Standard(\TestHelperExtjs::getContext());
$result = $textManager->searchItems($params);
$params = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('text.lists.type.domain' => 'text')))), 'start' => 0, 'limit' => 1);
$textListTypeManager = \Aimeos\Controller\ExtJS\Text\Lists\Type\Factory::createController(\TestHelperExtjs::getContext());
$resultType = $textListTypeManager->searchItems($params);
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('text.lists.parentid' => $result['items'][0]->{'text.id'}, 'text.lists.typeid' => $resultType['items'][0]->{'text.lists.type.id'}, 'text.lists.domain' => 'text', 'text.lists.refid' => -1, 'text.lists.datestart' => '2000-01-01 00:00:00', 'text.lists.dateend' => '2001-01-01 00:00:00', 'text.lists.config' => array('test' => 'unit'), 'text.lists.position' => 1, 'text.lists.status' => 1));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('text.lists.refid' => -1)))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'text.lists.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'text.lists.id'});
$this->assertEquals($saved['items']->{'text.lists.id'}, $searched['items'][0]->{'text.lists.id'});
$this->assertEquals($saved['items']->{'text.lists.parentid'}, $searched['items'][0]->{'text.lists.parentid'});
$this->assertEquals($saved['items']->{'text.lists.typeid'}, $searched['items'][0]->{'text.lists.typeid'});
$this->assertEquals($saved['items']->{'text.lists.domain'}, $searched['items'][0]->{'text.lists.domain'});
$this->assertEquals($saved['items']->{'text.lists.refid'}, $searched['items'][0]->{'text.lists.refid'});
$this->assertEquals($saved['items']->{'text.lists.datestart'}, $searched['items'][0]->{'text.lists.datestart'});
$this->assertEquals($saved['items']->{'text.lists.dateend'}, $searched['items'][0]->{'text.lists.dateend'});
$this->assertEquals($saved['items']->{'text.lists.config'}, $searched['items'][0]->{'text.lists.config'});
$this->assertEquals($saved['items']->{'text.lists.position'}, $searched['items'][0]->{'text.lists.position'});
$this->assertEquals($saved['items']->{'text.lists.status'}, $searched['items'][0]->{'text.lists.status'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例8: testSaveDeleteItem
public function testSaveDeleteItem()
{
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('product.code' => 'CNC')))));
$prodCtrl = new \Aimeos\Controller\ExtJS\Product\Standard(\TestHelperExtjs::getContext());
$products = $prodCtrl->searchItems($searchParams);
$this->assertEquals(1, count($products['items']));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('product.property.type.code' => 'package-weight')))));
$typeCtrl = new \Aimeos\Controller\ExtJS\Product\Property\Type\Standard(\TestHelperExtjs::getContext());
$types = $typeCtrl->searchItems($searchParams);
$this->assertEquals(1, count($types['items']));
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('product.property.parentid' => $products['items'][0]->{'product.id'}, 'product.property.typeid' => $types['items'][0]->{'product.property.type.id'}, 'product.property.languageid' => 'de', 'product.property.value' => 'unittest'));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('product.property.value' => 'unittest')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'product.property.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'product.property.id'});
$this->assertEquals($saved['items']->{'product.property.id'}, $searched['items'][0]->{'product.property.id'});
$this->assertEquals($saved['items']->{'product.property.parentid'}, $searched['items'][0]->{'product.property.parentid'});
$this->assertEquals($saved['items']->{'product.property.typeid'}, $searched['items'][0]->{'product.property.typeid'});
$this->assertEquals($saved['items']->{'product.property.languageid'}, $searched['items'][0]->{'product.property.languageid'});
$this->assertEquals($saved['items']->{'product.property.value'}, $searched['items'][0]->{'product.property.value'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例9: testSaveDeleteItem
public function testSaveDeleteItem()
{
$manager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$baseManager = $manager->getSubManager('base');
$serviceManager = $baseManager->getSubManager('service');
$search = $serviceManager->createSearch();
$search->setConditions($search->compare('==', 'order.base.service.code', 'OGONE'));
$results = $serviceManager->searchItems($search);
if (($expected = reset($results)) === false) {
throw new \Exception('No service item found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('order.base.service.attribute.parentid' => $expected->getId(), 'order.base.service.attribute.code' => 'FooBar', 'order.base.service.attribute.value' => 'ValueTest', 'order.base.service.attribute.name' => 'TestName'));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => array('==' => (object) array('order.base.service.attribute.code' => 'FooBar')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'order.base.service.attribute.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'order.base.service.attribute.id'});
$this->assertEquals($saved['items']->{'order.base.service.attribute.id'}, $searched['items'][0]->{'order.base.service.attribute.id'});
$this->assertEquals($saved['items']->{'order.base.service.attribute.ordservid'}, $searched['items'][0]->{'order.base.service.attribute.ordservid'});
$this->assertEquals($saved['items']->{'order.base.service.attribute.code'}, $searched['items'][0]->{'order.base.service.attribute.code'});
$this->assertEquals($saved['items']->{'order.base.service.attribute.name'}, $searched['items'][0]->{'order.base.service.attribute.name'});
$this->assertEquals($saved['items']->{'order.base.service.attribute.value'}, $searched['items'][0]->{'order.base.service.attribute.value'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例10: testSaveDeleteItem
public function testSaveDeleteItem()
{
$manager = \Aimeos\MShop\Plugin\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$typeManager = $manager->getSubManager('type');
$search = $typeManager->createSearch();
$search->setConditions($search->compare('==', 'plugin.type.code', 'order'));
$result = $typeManager->searchItems($search);
if (($type = reset($result)) === false) {
throw new \RuntimeException('No plugin type found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('plugin.status' => 1, 'plugin.position' => 2, 'plugin.provider' => 'test provider', 'plugin.config' => array('url' => 'www.url.de'), 'plugin.typeid' => $type->getId(), 'plugin.label' => 'test plugin'));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => array('==' => (object) array('plugin.provider' => 'test provider')))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'plugin.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'plugin.id'});
$this->assertEquals($saved['items']->{'plugin.id'}, $searched['items'][0]->{'plugin.id'});
$this->assertEquals($saved['items']->{'plugin.status'}, $searched['items'][0]->{'plugin.status'});
$this->assertEquals($saved['items']->{'plugin.position'}, $searched['items'][0]->{'plugin.position'});
$this->assertEquals($saved['items']->{'plugin.provider'}, $searched['items'][0]->{'plugin.provider'});
$this->assertEquals($saved['items']->{'plugin.config'}, $searched['items'][0]->{'plugin.config'});
$this->assertEquals($saved['items']->{'plugin.typeid'}, $searched['items'][0]->{'plugin.typeid'});
$this->assertEquals($saved['items']->{'plugin.label'}, $searched['items'][0]->{'plugin.label'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例11: testSaveDeleteItem
public function testSaveDeleteItem()
{
$serviceManager = \Aimeos\MShop\Service\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$search = $serviceManager->createSearch();
$search->setConditions($search->compare('==', 'service.label', 'unitlabel'));
$resultService = $serviceManager->searchItems($search);
if (($item = reset($resultService)) === false) {
throw new \Exception('No service item found');
}
$params = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('service.lists.type.domain' => 'product')))), 'start' => 0, 'limit' => 1);
$serviceListTypeManager = \Aimeos\Controller\ExtJS\Service\Lists\Type\Factory::createController(\TestHelperExtjs::getContext());
$resultType = $serviceListTypeManager->searchItems($params);
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('service.lists.parentid' => $item->getId(), 'service.lists.typeid' => $resultType['items'][0]->{'service.lists.type.id'}, 'service.lists.domain' => 'product', 'service.lists.refid' => -1, 'service.lists.datestart' => '2000-01-01 00:00:00', 'service.lists.dateend' => '2001-01-01 00:00:00', 'service.lists.config' => array('test' => 'unit'), 'service.lists.position' => 1, 'service.lists.status' => 1));
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('service.lists.refid' => -1)))));
$saved = $this->object->saveItems($saveParams);
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'service.lists.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'service.lists.id'});
$this->assertEquals($saved['items']->{'service.lists.id'}, $searched['items'][0]->{'service.lists.id'});
$this->assertEquals($saved['items']->{'service.lists.parentid'}, $searched['items'][0]->{'service.lists.parentid'});
$this->assertEquals($saved['items']->{'service.lists.typeid'}, $searched['items'][0]->{'service.lists.typeid'});
$this->assertEquals($saved['items']->{'service.lists.domain'}, $searched['items'][0]->{'service.lists.domain'});
$this->assertEquals($saved['items']->{'service.lists.refid'}, $searched['items'][0]->{'service.lists.refid'});
$this->assertEquals($saved['items']->{'service.lists.datestart'}, $searched['items'][0]->{'service.lists.datestart'});
$this->assertEquals($saved['items']->{'service.lists.dateend'}, $searched['items'][0]->{'service.lists.dateend'});
$this->assertEquals($saved['items']->{'service.lists.config'}, $searched['items'][0]->{'service.lists.config'});
$this->assertEquals($saved['items']->{'service.lists.position'}, $searched['items'][0]->{'service.lists.position'});
$this->assertEquals($saved['items']->{'service.lists.status'}, $searched['items'][0]->{'service.lists.status'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例12: testSaveDeleteItem
public function testSaveDeleteItem()
{
$ctx = \TestHelperExtjs::getContext();
$productManager = \Aimeos\MShop\Product\Manager\Factory::createManager($ctx);
$warehouseManager = $productManager->getSubManager('stock')->getSubManager('warehouse');
$search = $warehouseManager->createSearch();
$search->setConditions($search->compare('==', 'product.stock.warehouse.code', 'default'));
$search->setSlice(0, 1);
$items = $warehouseManager->searchItems($search);
if (($warehouseItem = reset($items)) === false) {
throw new \RuntimeException('No item found');
}
$search = $productManager->createSearch();
$search->setConditions($search->compare('~=', 'product.label', 'Cheapest'));
$items = $productManager->searchItems($search);
if (($productItem = reset($items)) === false) {
throw new \RuntimeException('No item found');
}
$saveParams = (object) array('site' => 'unittest', 'items' => (object) array('product.stock.parentid' => $productItem->getId(), 'product.stock.warehouseid' => $warehouseItem->getId(), 'product.stock.stocklevel' => 999, 'product.stock.dateback' => '2000-01-01 00:00:01'));
$saved = $this->object->saveItems($saveParams);
$searchParams = (object) array('site' => 'unittest', 'condition' => (object) array('&&' => array(0 => (object) array('==' => (object) array('product.stock.dateback' => '2000-01-01 00:00:01')))));
$searched = $this->object->searchItems($searchParams);
$deleteParams = (object) array('site' => 'unittest', 'items' => $saved['items']->{'product.stock.id'});
$this->object->deleteItems($deleteParams);
$result = $this->object->searchItems($searchParams);
$this->assertInternalType('object', $saved['items']);
$this->assertNotNull($saved['items']->{'product.stock.id'});
$this->assertEquals($saved['items']->{'product.stock.id'}, $searched['items'][0]->{'product.stock.id'});
$this->assertEquals($saved['items']->{'product.stock.parentid'}, $searched['items'][0]->{'product.stock.parentid'});
$this->assertEquals($saved['items']->{'product.stock.warehouseid'}, $searched['items'][0]->{'product.stock.warehouseid'});
$this->assertEquals($saved['items']->{'product.stock.stocklevel'}, $searched['items'][0]->{'product.stock.stocklevel'});
$this->assertEquals($saved['items']->{'product.stock.dateback'}, $searched['items'][0]->{'product.stock.dateback'});
$this->assertEquals(1, count($searched['items']));
$this->assertEquals(0, count($result['items']));
}
示例13: testFinish
public function testFinish()
{
$productManager = \Aimeos\MShop\Product\Manager\Factory::createManager(\TestHelperExtjs::getContext());
$search = $productManager->createSearch();
$search->setConditions($search->compare('==', 'product.code', array('CNC', 'CNE')));
$result = $productManager->searchItems($search);
$this->object->finish((object) array('site' => 'unittest', 'items' => array_keys($result)));
}
示例14: testAbstractAddDecoratorsExceptionWrongClass
public function testAbstractAddDecoratorsExceptionWrongClass()
{
$context = \TestHelperExtjs::getContext();
$config = $context->getConfig();
$config->set('controller/extjs/common/decorators/default', array('WrongClass'));
$this->setExpectedException('\\Aimeos\\Controller\\ExtJS\\Exception');
\Aimeos\Controller\ExtJS\Plugin\Factorylocal::createController($context, 'Standard', 'plugin');
}
示例15: 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 = \TestHelperExtjs::getContext();
$config = $this->context->getConfig();
$config->set('controller/extjs/common/decorators/default', array());
$config->set('controller/extjs/admin/log/decorators/global', array());
$config->set('controller/extjs/admin/log/decorators/local', array());
}