/**
  * @param Template $entity
  * @return Template
  */
 protected function beforeProcessEntity($entity)
 {
     if ($this->logger) {
         $this->logger->info('Syncing MailChimp Template [origin_id=' . $entity->getOriginId() . ']');
     }
     return parent::beforeProcessEntity($entity);
 }
예제 #2
0
 public function testPreUpdate()
 {
     $this->assertNull($this->target->getUpdatedAt());
     $this->target->preUpdate();
     $this->assertInstanceOf('\\DateTime', $this->target->getUpdatedAt());
 }
 /**
  * @param array $expected
  *
  * @dataProvider templateConvertDataProvider
  */
 public function testSearchEntitiesByIdValidResult(array $expected)
 {
     $this->setUpExpects();
     $templateOne = new Template();
     $templateOne->setCategory($expected[0]['name'])->setName($expected[0]['children'][0]['name']);
     $this->entityRepository->expects($this->once())->method('findOneBy')->will($this->returnValue($templateOne));
     $search = "test;1";
     $firstResult = 1;
     $maxResults = 2;
     $result = $this->searchHandler->search($search, $firstResult, $maxResults, true);
     $this->assertFalse($result['more']);
     $this->assertCount(1, $result['results']);
     $this->assertEquals("test", $result['results'][0]['id']);
 }