/** * @handleName handle_that_is_loaded */ public function testItDoesNotIncludeAHandleIfItIsAlreadyLoaded() { $processor = $this->createProcessor(); $loader = $this->createLoader(); $layout = $this->createLayout($loader); $loader->expects($this->once())->method('isLoaded')->with('handle_that_is_loaded')->willReturn(true); $loader->expects($this->never())->method('loadIntoProcessor'); $this->assertSame($this->layoutItem, $this->layoutItem->execute($layout, $processor)); }
/** * * @blockId block_one */ public function testItRemovesAllOccurrencesOfLoadTypeItemsWithMentionedBlockId() { $processor = $this->createProcessor(); $layout = $this->createLayout(); $itemOne = $this->createLayoutItem(); $itemTwo = $this->createLayoutItem(); $processor->expects($this->once())->method('findItemsByBlockIdAndType')->with('block_one', EcomDev_LayoutCompiler_Contract_Layout_ItemInterface::TYPE_LOAD)->willReturn(array($itemOne, $itemTwo)); $processor->expects($this->exactly(2))->method('removeItem')->withConsecutive(array($itemOne), array($itemTwo))->willReturnSelf(); $this->assertSame($this->layoutItem, $this->layoutItem->execute($layout, $processor)); }