getLastValidBlockItem() public méthode

Returns the last valid item, for a given block.
public getLastValidBlockItem ( Block $block ) : Item | null
$block eZ\Publish\Core\FieldType\Page\Parts\Block
Résultat eZ\Publish\Core\FieldType\Page\Parts\Item | null
 /**
  * @covers eZ\Publish\Core\FieldType\Page\PageService::hasStorageGateway
  * @covers eZ\Publish\Core\FieldType\Page\PageService::getStorageGateway
  * @covers eZ\Publish\Core\FieldType\Page\PageService::getLastValidBlockItem
  */
 public function testGetLastValidBlockItem()
 {
     $block = $this->buildBlock();
     $lastValidItem = new Item();
     $this->storageGateway->expects($this->once())->method('getLastValidBlockItem')->with($block)->will($this->returnValue($lastValidItem));
     $this->pageService->setStorageGateway($this->storageGateway);
     // Calling assertion twice to test cache (comes along with storage gateway's getLastValidBlockItem() that should be called only once. See above)
     $this->assertSame($lastValidItem, $this->pageService->getLastValidBlockItem($block));
     $this->assertSame($lastValidItem, $this->pageService->getLastValidBlockItem($block));
 }