public function testResetId() { $comment = new \OC\Comments\Comment(); $comment->setId('c23'); $comment->setId(''); $this->assertSame('', $comment->getId()); }
public function testSaveAsChild() { $id = $this->addDatabaseEntry(0, 0); $manager = $this->getManager(); for ($i = 0; $i < 3; $i++) { $comment = new \OC\Comments\Comment(); $comment->setActor('user', 'alice')->setObject('file', 'file64')->setParentId(strval($id))->setMessage('full ack')->setVerb('comment')->setCreationDateTime(new \DateTime('+' . $i . ' minutes')); $manager->save($comment); $this->assertSame($comment->getTopmostParentId(), strval($id)); $parentComment = $manager->get(strval($id)); $this->assertSame($parentComment->getChildrenCount(), $i + 1); $this->assertEquals($parentComment->getLatestChildDateTime(), $comment->getCreationDateTime()); } }
/** * @expectedException \OCP\Comments\MessageTooLongException */ public function testSetUberlongMessage() { $comment = new \OC\Comments\Comment(); $msg = str_pad('', IComment::MAX_MESSAGE_LENGTH + 1, 'x'); $comment->setMessage($msg); }
public function testResetId() { $comment = new \OC\Comments\Comment(); $comment->setId('c23'); $comment->setId(''); }