/** * test change entity status attributes * * @return void */ public function testSetStatus() { $entity = new DocumentEntity(); $entity->approve(); $this->assertEquals(DocumentEntity::APPROVED_APPROVED, $entity->approved); $this->assertEquals(DocumentEntity::DISPLAY_VISIBLE, $entity->display); $entity->reject(); $this->assertEquals(DocumentEntity::PUBLISHED_REJECTED, $entity->approved); $this->assertEquals(DocumentEntity::DISPLAY_HIDDEN, $entity->display); $entity->approveWait(); $this->assertEquals(DocumentEntity::PUBLISHED_WAITING, $entity->approved); $this->assertEquals(DocumentEntity::DISPLAY_HIDDEN, $entity->display); $entity->publish(); $this->assertEquals(DocumentEntity::PUBLISHED_PUBLISHED, $entity->published); $this->assertEquals(DocumentEntity::DISPLAY_VISIBLE, $entity->display); $entity->reserve(); $this->assertEquals(DocumentEntity::PUBLISHED_RESERVED, $entity->published); $this->assertEquals(DocumentEntity::DISPLAY_HIDDEN, $entity->display); $entity->trash(); $this->assertEquals(DocumentEntity::STATUS_TRASH, $entity->status); $entity->restore(); $this->assertEquals(DocumentEntity::STATUS_PUBLIC, $entity->status); $entity->temporary(); $this->assertEquals(DocumentEntity::STATUS_TEMP, $entity->status); $this->assertEquals(DocumentEntity::DISPLAY_HIDDEN, $entity->display); }