Пример #1
0
 public function testSearchMShopException()
 {
     $object = $this->getMockBuilder('\\Aimeos\\Admin\\JQAdm\\Dashboard\\Standard')->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))->setMethods(array('getSubClients'))->getMock();
     $object->expects($this->once())->method('getSubClients')->will($this->throwException(new \Aimeos\MShop\Exception()));
     $object->setView($this->getViewNoRender());
     $object->search();
 }
Пример #2
0
 protected function setUp()
 {
     $this->mock = $this->getMockBuilder('Aimeos\\Admin\\JQAdm\\Product\\Standard')->setMethods(array('copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient'))->disableOriginalConstructor()->getMock();
     $templatePaths = \TestHelperJqadm::getTemplatePaths();
     $context = \TestHelperJqadm::getContext();
     $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Sites($this->mock, $context, $templatePaths);
 }
Пример #3
0
 public function testSetView()
 {
     $view = \TestHelperJqadm::getView();
     $this->object->setView($view);
     $this->assertInternalType('array', $view->pageSites);
     $this->assertInternalType('array', $view->pageLanguages);
 }
Пример #4
0
 private static function getAimeos()
 {
     if (!isset(self::$aimeos)) {
         require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'Bootstrap.php';
         self::$aimeos = new \Aimeos\Bootstrap(array(), false);
     }
     return self::$aimeos;
 }
Пример #5
0
 protected function setUp()
 {
     $this->view = \TestHelperJqadm::getView();
     $this->context = \TestHelperJqadm::getContext();
     $templatePaths = \TestHelperJqadm::getTemplatePaths();
     $this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard($this->context, $templatePaths);
     $this->object->setView($this->view);
 }
Пример #6
0
 public function testSaveMShopException()
 {
     $object = $this->getMockBuilder('\\Aimeos\\Admin\\JQAdm\\Product\\Physical\\Standard')->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))->setMethods(array('updateItems'))->getMock();
     $object->expects($this->once())->method('updateItems')->will($this->throwException(new \Aimeos\MShop\Exception()));
     $object->setView(\TestHelperJqadm::getView());
     $this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
     $object->save();
 }
Пример #7
0
 public function testSave()
 {
     $view = \TestHelperJqadm::getView();
     $view->item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC');
     $this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
     $this->object->setView($view);
     $result = $this->object->save();
     $this->assertEquals('test', $result);
 }
Пример #8
0
 protected function setUp()
 {
     $this->context = \TestHelperJqadm::getContext();
     $this->context->setView(\TestHelperJqadm::getView());
     $config = $this->context->getConfig();
     $config->set('admin/jqadm/common/decorators/default', array());
     $config->set('admin/jqadm/product/decorators/global', array());
     $config->set('admin/jqadm/product/decorators/local', array());
 }
Пример #9
0
 private static function getAimeos()
 {
     if (!isset(self::$aimeos)) {
         require_once 'Bootstrap.php';
         spl_autoload_register('Aimeos::autoload');
         $extdir = dirname(dirname(dirname(dirname(__DIR__))));
         self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
     }
     return self::$aimeos;
 }
Пример #10
0
 protected function setUp()
 {
     $this->view = \TestHelperJqadm::getView();
     $request = $this->getMock('\\Psr\\Http\\Message\\ServerRequestInterface');
     $helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
     $this->view->addHelper('request', $helper);
     $this->context = \TestHelperJqadm::getContext();
     $templatePaths = \TestHelperJqadm::getTemplatePaths();
     $this->object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths);
     $this->object->setView($this->view);
 }
Пример #11
0
 protected function setUp()
 {
     $this->view = \TestHelperJqadm::getView();
     $request = $this->getMock('\\Psr\\Http\\Message\\ServerRequestInterface');
     $helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
     $this->view->addHelper('request', $helper);
     $this->context = \TestHelperJqadm::getContext();
     $templatePaths = \TestHelperJqadm::getTemplatePaths();
     $this->object = $this->getMockBuilder('\\Aimeos\\Admin\\JQAdm\\Product\\Download\\Standard')->setConstructorArgs(array($this->context, $templatePaths))->setMethods(array('storeFile'))->getMock();
     $this->object->setView($this->view);
 }
Пример #12
0
 public function testSave()
 {
     $item = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC');
     $tags = array('product', 'product-' . $item->getId());
     $view = \TestHelperJqadm::getView();
     $view->item = $item;
     $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags));
     $this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
     $this->object->setView($view);
     $result = $this->object->save();
     $this->assertEquals('test', $result);
 }
Пример #13
0
 public function testSave()
 {
     $view = \TestHelperJqadm::getView();
     $tags = array('catalog', 'catalog-1', 'catalog-2');
     $param = array('category' => array('catalog.id' => array('1', '2')));
     $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
     $view->addHelper('param', $helper);
     $this->cache->expects($this->once())->method('deleteByTags')->with($this->equalTo($tags));
     $this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
     $this->object->setView($view);
     $result = $this->object->save();
     $this->assertEquals('test', $result);
 }
Пример #14
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->context = \TestHelperJqadm::getContext();
     $paths = \TestHelperJqadm::getHtmlTemplatePaths();
     // $this->object = new \Aimeos\Client\JQAdm\...\Standard( $this->context, $paths );
 }
Пример #15
0
<?php

/**
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
 * @copyright Aimeos (aimeos.org), 2015
 */
/*
 * Set error reporting to maximum
 */
error_reporting(-1);
ini_set('display_errors', true);
date_default_timezone_set('UTC');
/*
 * Set locale settings to reasonable defaults
 */
setlocale(LC_ALL, 'en_US.UTF-8');
setlocale(LC_NUMERIC, 'POSIX');
setlocale(LC_CTYPE, 'en_US.UTF-8');
setlocale(LC_TIME, 'POSIX');
require_once 'TestHelperJqadm.php';
TestHelperJqadm::bootstrap();
Пример #16
0
 protected function setUp()
 {
     $this->templatePaths = \TestHelperJqadm::getTemplatePaths();
     $this->context = \TestHelperJqadm::getContext();
     $this->context->setView(\TestHelperJqadm::getView());
 }