getType() public method

public getType ( )
Example #1
0
 public function testType()
 {
     $document = new Document(null, null, Document::TYPE_UNKNOWN);
     $this->assertSame(Document::TYPE_UNKNOWN, $document->getType());
     $this->assertFalse($document->isTypePost());
     $this->assertFalse($document->isTypePage());
     $this->assertFalse($document->isTypeApi());
     $document = new Document(null, null, Document::TYPE_PAGE);
     $this->assertSame(Document::TYPE_PAGE, $document->getType());
     $this->assertFalse($document->isTypePost());
     $this->assertTrue($document->isTypePage());
     $this->assertFalse($document->isTypeApi());
     $document = new Document(null, null, Document::TYPE_POST);
     $this->assertSame(Document::TYPE_POST, $document->getType());
     $this->assertTrue($document->isTypePost());
     $this->assertFalse($document->isTypePage());
     $this->assertFalse($document->isTypeApi());
     $document = new Document(null, null, Document::TYPE_API);
     $this->assertSame(Document::TYPE_API, $document->getType());
     $this->assertFalse($document->isTypePost());
     $this->assertFalse($document->isTypePage());
     $this->assertTrue($document->isTypeApi());
 }