Beispiel #1
0
 public function testGetGroups()
 {
     $context = $this->app->make('\\Aimeos\\Shop\\Base\\Context');
     $locale = $this->app->make('\\Aimeos\\Shop\\Base\\Locale');
     $ctx = $context->get(false);
     $ctx->setLocale($locale->getBackend($ctx, 'unittest'));
     $object = new \Aimeos\Shop\Base\Support($context, $locale);
     $this->assertEquals(array(), $object->getGroups($ctx));
 }
 public function testCheckGroup()
 {
     $context = $this->app->make('\\Aimeos\\Shop\\Base\\Context');
     $ctx = $context->get(false);
     $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
     $ctx->setLocale($localeManager->bootstrap('unittest', '', '', false));
     $ctxMock = $this->getMockBuilder('\\Aimeos\\Shop\\Base\\Context')->disableOriginalConstructor()->setMethods(array('get'))->getMock();
     $ctxMock->expects($this->once())->method('get')->will($this->returnValue($ctx));
     $object = new \Aimeos\Shop\Base\Support($ctxMock);
     $this->assertFalse($object->checkGroup(-1, 'admin'));
 }