Example #1
0
 public function testFindForDelete()
 {
     $queryBuilder = $this->setUpQueryBuilder($value = 'bar');
     $queryBuilder->expects($this->once())->method('getQuery')->will($this->returnValue($query = $this->createQueryMock()));
     $query->expects($this->once())->method('getSingleResult')->will($this->returnValue($result = 'result'));
     $this->assertSame($result, $this->repository->findForDelete(['foo' => $value], ['baz' => 'ASC']));
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function getProperty($property, $root = null)
 {
     if ($this->cache === null) {
         $translationMetadata = $this->getDocumentManager()->getClassMetadata($this->getClassMetadata()->getAssociationTargetClass($this->getTranslationAlias()));
         $this->cache = array_diff($this->getProperties($translationMetadata), $this->getProperties($this->getClassMetadata()));
     }
     if (in_array($this->getRootProperty($property), $this->cache, true)) {
         $root = $this->getTranslationAlias();
     }
     return parent::getProperty($property, $root);
 }
Example #3
0
 public function testProperty()
 {
     $this->repository->expects($this->once())->method('getProperty')->with($this->identicalTo($field = 'field'), $this->identicalTo($this->queryBuilder))->will($this->returnValue($property = 'property'));
     $this->assertSame($property, $this->builder->getProperty($field));
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function getProperty($field)
 {
     return $this->repository->getProperty($field, $this->queryBuilder);
 }