Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php
Show All 11 Lines | public function generateObject() { | ||||
list($name, $language, $content) = $this->newPasteContent(); | list($name, $language, $content) = $this->newPasteContent(); | ||||
$paste = PhabricatorPaste::initializeNewPaste($author); | $paste = PhabricatorPaste::initializeNewPaste($author); | ||||
$xactions = array(); | $xactions = array(); | ||||
$xactions[] = $this->newTransaction( | $xactions[] = $this->newTransaction( | ||||
PhabricatorPasteTransaction::TYPE_TITLE, | PhabricatorPasteTitleTransaction::TRANSACTIONTYPE, | ||||
$name); | $name); | ||||
$xactions[] = $this->newTransaction( | $xactions[] = $this->newTransaction( | ||||
PhabricatorPasteTransaction::TYPE_LANGUAGE, | PhabricatorPasteLanguageTransaction::TRANSACTIONTYPE, | ||||
$language); | $language); | ||||
$xactions[] = $this->newTransaction( | $xactions[] = $this->newTransaction( | ||||
PhabricatorPasteTransaction::TYPE_CONTENT, | PhabricatorPasteContentTransaction::TRANSACTIONTYPE, | ||||
$content); | $content); | ||||
$editor = id(new PhabricatorPasteEditor()) | $editor = id(new PhabricatorPasteEditor()) | ||||
->setActor($author) | ->setActor($author) | ||||
->setContentSource($this->getLipsumContentSource()) | ->setContentSource($this->getLipsumContentSource()) | ||||
->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
->applyTransactions($paste, $xactions); | ->applyTransactions($paste, $xactions); | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |