Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/project/lipsum/PhabricatorProjectTestDataGenerator.php b/src/applications/project/lipsum/PhabricatorProjectTestDataGenerator.php
index e29ee13f2d..771b6a8169 100644
--- a/src/applications/project/lipsum/PhabricatorProjectTestDataGenerator.php
+++ b/src/applications/project/lipsum/PhabricatorProjectTestDataGenerator.php
@@ -1,72 +1,78 @@
<?php
final class PhabricatorProjectTestDataGenerator
extends PhabricatorTestDataGenerator {
const GENERATORKEY = 'projects';
public function getGeneratorName() {
return pht('Projects');
}
public function generateObject() {
$author = $this->loadRandomUser();
$project = PhabricatorProject::initializeNewProject($author);
$xactions = array();
$xactions[] = $this->newTransaction(
PhabricatorProjectNameTransaction::TRANSACTIONTYPE,
$this->newProjectTitle());
+ $xactions[] = id(new PhabricatorProjectTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_CUSTOMFIELD)
+ ->setOldValue('')
+ ->setMetadataValue('customfield:key', 'std:project:internal:description')
+ ->setNewValue($this->newProjectTitle());
+
$xactions[] = $this->newTransaction(
PhabricatorProjectStatusTransaction::TRANSACTIONTYPE,
$this->newProjectStatus());
// Almost always make the author a member.
$members = array();
if ($this->roll(1, 20) > 2) {
$members[] = $author->getPHID();
}
// Add a few other members.
$size = $this->roll(2, 6, -2);
for ($ii = 0; $ii < $size; $ii++) {
$members[] = $this->loadRandomUser()->getPHID();
}
$xactions[] = $this->newTransaction(
PhabricatorTransactions::TYPE_EDGE,
array(
'+' => array_fuse($members),
),
array(
'edge:type' => PhabricatorProjectProjectHasMemberEdgeType::EDGECONST,
));
$editor = id(new PhabricatorProjectTransactionEditor())
->setActor($author)
->setContentSource($this->getLipsumContentSource())
->setContinueOnNoEffect(true)
->applyTransactions($project, $xactions);
return $project;
}
protected function newEmptyTransaction() {
return new PhabricatorProjectTransaction();
}
public function newProjectTitle() {
return id(new PhabricatorProjectNameContextFreeGrammar())
->generate();
}
public function newProjectStatus() {
if ($this->roll(1, 20) > 5) {
return PhabricatorProjectStatus::STATUS_ACTIVE;
} else {
return PhabricatorProjectStatus::STATUS_ARCHIVED;
}
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Apr 29, 5:35 AM (23 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108200
Default Alt Text
(2 KB)

Event Timeline