コード例 #1
0
 protected function setUp()
 {
     parent::setUp();
     $this->factory = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Block\\BlockManagerFactoryInterface');
     $this->blockRepository = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Propel\\BlockRepositoryPropel')->disableOriginalConstructor()->getMock();
     $this->blocksAdder = new BlocksAdder($this->blockRepository, $this->factory);
 }
コード例 #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->kernel = $this->getMock('Symfony\\Component\\HttpKernel\\KernelInterface');
     $this->validator = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Validator\\ParametersValidatorPageManager')->disableOriginalConstructor()->getMock();
     $this->blockRepository = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Propel\\BlockRepositoryPropel')->disableOriginalConstructor()->getMock();
     $this->initRepository();
     $this->translator = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Translator\\TranslatorInterface');
     $this->container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
 }
コード例 #3
0
 protected function setUp()
 {
     parent::setUp();
     $this->validator = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Validator\\ParametersValidatorLanguageManager')->disableOriginalConstructor()->getMock();
     $this->languageRepository = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Propel\\LanguageRepositoryPropel')->disableOriginalConstructor()->getMock();
     $this->languageRepository->expects($this->any())->method('getRepositoryObjectClassName')->will($this->returnValue('\\RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Model\\Language'));
     $this->factoryRepository = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Factory\\FactoryRepositoryInterface');
     $this->factoryRepository->expects($this->any())->method('createRepository')->will($this->returnValue($this->languageRepository));
     $this->languageManager = new LanguageManager($this->eventsHandler, $this->factoryRepository, $this->validator);
 }
コード例 #4
0
 protected function setUp()
 {
     parent::setUp();
     $this->validator = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Validator\\ParametersValidatorPageManager')->disableOriginalConstructor()->getMock();
     $this->blockRepository = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Propel\\BlockRepositoryPropel')->disableOriginalConstructor()->getMock();
     $this->factoryRepository = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Factory\\FactoryRepositoryInterface');
     $this->factoryRepository->expects($this->any())->method('createRepository')->will($this->returnValue($this->blockRepository));
     $this->blockManager = new BlockManagerUnitTester($this->eventsHandler, $this->factoryRepository, $this->validator);
     $this->blockManager->setDefaultValue(array("Content" => "Test value"));
 }
コード例 #5
0
 protected function setUp()
 {
     parent::setUp();
     $this->factory = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Block\\BlockManagerFactoryInterface');
     $this->blockRepository = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Propel\\BlockRepositoryPropel')->disableOriginalConstructor()->getMock();
     $this->blocksAdded = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Slot\\Blocks\\BlocksAdder')->disableOriginalConstructor()->getMock();
     $this->blocksRemover = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Slot\\Blocks\\BlocksRemover')->disableOriginalConstructor()->getMock();
     $this->blockManagersCollection = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Slot\\Blocks\\BlockManagersCollection')->getMock();
     $this->slot = new Slot('test', array('repeated' => 'page'));
     $this->slotManager = new SlotManager($this->slot, $this->blockRepository, $this->factory);
 }
コード例 #6
0
 protected function setUp()
 {
     parent::setUp();
     $this->themeSlots = $this->getMock('RedKiteLabs\\ThemeEngineBundle\\Core\\ThemeSlots\\ThemeSlotsInterface');
     $this->template = $this->getMockBuilder('RedKiteLabs\\ThemeEngineBundle\\Core\\Template\\Template')->disableOriginalConstructor()->getMock();
     $this->pageBlocks = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\PageBlocks\\PageBlocks')->disableOriginalConstructor()->getMock();
     $this->pageBlocks->expects($this->any())->method('getIdPage')->will($this->returnValue(2));
     $this->pageBlocks->expects($this->any())->method('getIdLanguage')->will($this->returnValue(2));
     $this->validator = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Validator\\ParametersValidatorPageManager')->disableOriginalConstructor()->getMock();
     $this->blockManager = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBaseBlocksBundle\\Core\\Block\\Image\\BlockManagerImage')->disableOriginalConstructor()->getMock();
     $this->blockRepository = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Propel\\BlockRepositoryPropel')->disableOriginalConstructor()->getMock();
     $this->factoryRepository = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Repository\\Factory\\FactoryRepositoryInterface');
     $this->factoryRepository->expects($this->any())->method('createRepository')->will($this->returnValue($this->blockRepository));
     $this->factory = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Block\\BlockManagerFactoryInterface');
     $this->factory->expects($this->any())->method('createBlockManager')->will($this->returnValue($this->blockManager));
 }
コード例 #7
0
 protected function setUp()
 {
     parent::setUp();
     $this->blocksManagerCollection = new BlockManagersCollection();
 }