Yosymfony\Spress\Core\DataSource\Item::getId PHP Method

getId() public method

public getId ( )
    public function getId()
    {
        return $this->id;
    }

Usage Example

Example #1
0
 public function testDefaultContent()
 {
     $item = new Item('Test of content', 'index.html', []);
     $this->assertEquals('index.html', $item->getId());
     $this->assertEquals(item::TYPE_ITEM, $item->getType());
     $this->assertEquals('pages', $item->getCollection());
     $this->assertEquals('Test of content', $item->getContent());
     $this->assertEquals('Test of content', $item->getContent(Item::SNAPSHOT_RAW));
     $this->assertCount(0, $item->getAttributes());
     $this->assertFalse($item->isBinary());
     $item->setCollection('posts');
     $this->assertEquals('posts', $item->getCollection());
 }