本文整理汇总了PHP中Aimeos\MShop\Factory::setCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::setCache方法的具体用法?PHP Factory::setCache怎么用?PHP Factory::setCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aimeos\MShop\Factory
的用法示例。
在下文中一共展示了Factory::setCache方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSave
public function testSave()
{
$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
$item = $manager->findItem('CNC');
$item->setCode('jqadm-test-image');
$item->setId(null);
$manager->saveItem($item);
$param = array('image' => array('product.lists.id' => array(''), 'media.languageid' => array('de'), 'media.label' => array('test')));
$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
$this->view->addHelper('param', $helper);
$files = array('image' => array('files' => array(array('tmp_name' => '', 'name' => '', 'type' => '', 'size' => 0, 'error' => 0))));
$helper = $this->getMockBuilder('\\Aimeos\\MW\\View\\Helper\\Request\\Standard')->setConstructorArgs(array($this->view, '', '', null, $files))->setMethods(array('checkUploadedFile'))->getMock();
$this->view->addHelper('request', $helper);
$this->view->item = $item;
$name = 'AdminJQAdmProductImageSave';
$this->context->getConfig()->set('controller/common/media/name', $name);
$cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('add'))->getMock();
\Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub);
$cntlStub->expects($this->once())->method('add');
$mediaStub = $this->getMockBuilder('\\Aimeos\\MShop\\Media\\Manager\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
\Aimeos\MShop\Factory::injectManager($this->context, 'media', $mediaStub);
$mediaStub->expects($this->once())->method('saveItem');
\Aimeos\MShop\Factory::setCache(true);
$result = $this->object->save();
\Aimeos\MShop\Factory::setCache(false);
$item = $manager->getItem($item->getId(), array('media'));
$manager->deleteItem($item->getId());
$this->assertNull($this->view->get('errors'));
$this->assertNull($result);
$this->assertEquals(1, count($item->getListItems('media')));
}
示例2: bootstrap
public static function bootstrap()
{
set_error_handler('TestHelperExtjs::errorHandler');
self::getAimeos();
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\Controller\ExtJS\Factory::setCache(false);
}
示例3: tearDown
protected function tearDown()
{
\Aimeos\MShop\Factory::clear();
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\Controller\Frontend\Basket\Factory::createController($this->context)->clear();
unset($this->object);
}
示例4: testSave
public function testSave()
{
$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
$item = $manager->findItem('CNE');
$item->setCode('jqadm-test-download');
$item->setId(null);
$manager->saveItem($item);
$param = array('download' => array('product.lists.id' => '', 'product.lists.status' => '1', 'attribute.label' => 'test'));
$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
$this->view->addHelper('param', $helper);
$file = $this->getMockBuilder('\\Psr\\Http\\Message\\UploadedFileInterface')->getMock();
$file->expects($this->any())->method('getError')->will($this->returnValue(UPLOAD_ERR_OK));
$request = $this->getMockBuilder('\\Psr\\Http\\Message\\ServerRequestInterface')->getMock();
$request->expects($this->any())->method('getUploadedFiles')->will($this->returnValue(array('download' => array('file' => $file))));
$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request);
$this->view->addHelper('request', $helper);
$this->view->item = $item;
$this->object->expects($this->once())->method('storeFile')->will($this->returnValue('test/file.ext'));
$attributeStub = $this->getMockBuilder('\\Aimeos\\MShop\\Attribute\\Manager\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
$attributeStub->expects($this->once())->method('saveItem');
\Aimeos\MShop\Factory::injectManager($this->context, 'attribute', $attributeStub);
\Aimeos\MShop\Factory::setCache(true);
$result = $this->object->save();
\Aimeos\MShop\Factory::setCache(false);
$item = $manager->getItem($item->getId(), array('attribute'));
$manager->deleteItem($item->getId());
$this->assertNull($this->view->get('errors'));
$this->assertNull($result);
$this->assertEquals(1, count($item->getListItems('attribute', 'hidden')));
}
示例5: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\MShop\Factory::clear();
$this->object = null;
if (file_exists('tmp/import.zip')) {
unlink('tmp/import.zip');
}
}
示例6: testClearSpecific
public function testClearSpecific()
{
$cache = \Aimeos\MShop\Factory::setCache(true);
$context = \TestHelperMShop::getContext();
$managerA1 = \Aimeos\MShop\Factory::createManager($context, 'attribute');
$managerB1 = \Aimeos\MShop\Factory::createManager($context, 'attribute/lists/type');
\Aimeos\MShop\Factory::clear((string) $context, 'attribute');
$managerA2 = \Aimeos\MShop\Factory::createManager($context, 'attribute');
$managerB2 = \Aimeos\MShop\Factory::createManager($context, 'attribute/lists/type');
\Aimeos\MShop\Factory::setCache($cache);
$this->assertNotSame($managerA1, $managerA2);
$this->assertSame($managerB1, $managerB2);
}
示例7: bootstrap
public static function bootstrap()
{
self::getAimeos();
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\Controller\Frontend\Factory::setCache(false);
}
示例8: tearDown
protected function tearDown()
{
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\MShop\Factory::clear();
}
示例9: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\MShop\Factory::clear();
$this->object = null;
}
示例10: testProcessCheckDownload
public function testProcessCheckDownload()
{
$managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Lists\\Standard')->setConstructorArgs(array($this->context))->setMethods(array('saveItem'))->getMock();
$managerStub->expects($this->once())->method('saveItem');
\Aimeos\MShop\Factory::injectManager($this->context, 'customer/lists', $managerStub);
$class = new \ReflectionClass('\\Aimeos\\Client\\Html\\Account\\Download\\Standard');
$method = $class->getMethod('checkDownload');
$method->setAccessible(true);
\Aimeos\MShop\Factory::setCache(true);
$result = $method->invokeArgs($this->object, array(123, 321));
\Aimeos\MShop\Factory::setCache(false);
$this->assertTrue($result);
}
示例11: bootstrap
public static function bootstrap()
{
self::getAimeos();
\Aimeos\MShop\Factory::setCache(false);
\Aimeos\Admin\JsonAdm\Factory::setCache(false);
}