Exemplo n.º 1
0
 public function testSetView()
 {
     $view = \TestHelperJqadm::getView();
     $this->object->setView($view);
     $this->assertInternalType('array', $view->pageSites);
     $this->assertInternalType('array', $view->pageLanguages);
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
 protected function setUp()
 {
     $this->view = \TestHelperJqadm::getView();
     $this->context = \TestHelperJqadm::getContext();
     $templatePaths = \TestHelperJqadm::getTemplatePaths();
     $this->object = new \Aimeos\Admin\JQAdm\Dashboard\Order\Paymentstatus\Standard($this->context, $templatePaths);
     $this->object->setView($this->view);
 }
Exemplo n.º 4
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();
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
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());
 }
Exemplo n.º 7
0
 protected function setUp()
 {
     $this->view = \TestHelperJqadm::getView();
     $request = $this->getMockBuilder('\\Psr\\Http\\Message\\ServerRequestInterface')->getMock();
     $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\Dashboard\Standard($this->context, $templatePaths);
     $this->object->setView($this->view);
 }
Exemplo n.º 8
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);
 }
Exemplo n.º 9
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);
 }
Exemplo n.º 10
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);
 }
Exemplo n.º 11
0
 protected function setUp()
 {
     $this->templatePaths = \TestHelperJqadm::getTemplatePaths();
     $this->context = \TestHelperJqadm::getContext();
     $this->context->setView(\TestHelperJqadm::getView());
 }