private function createTopics(ManagerRegistry $mongo, DocumentManager $dm)
 {
     $repository = $mongo->getRepository('DembeloMain:Topic');
     $this->dummyData['topics'] = array();
     $topicData = array(array('name' => 'Themenfeld 2', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 3', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 4', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 5', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 6', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 7', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 8', 'status' => Topic::STATUS_ACTIVE), array('name' => 'Themenfeld 9', 'status' => Topic::STATUS_ACTIVE));
     foreach ($topicData as $topicDatum) {
         $topic = $repository->findOneByName($topicDatum['name']);
         if (is_null($topic)) {
             $topic = new Topic();
             $topic->setName($topicDatum['name']);
             $topic->setStatus($topicDatum['status']);
             $dm->persist($topic);
         }
         $this->dummyData['topics'][] = $topic;
     }
 }
Esempio n. 2
0
 /**
  * tests getStatus()
  */
 public function testGetStatusShouldBeEqualSetStatus()
 {
     $this->topic->setStatus('teststatus');
     $this->assertEquals('teststatus', $this->topic->getStatus());
 }