/**
  * @param Adapter   $adapter
  * @param Extractor $annotationExtractor
  * @param Generator $asserterGenerator
  * @param Manager   $assertionManager
  * @param \Closure  $reflectionClassFactory
  * @param \Closure  $phpExtensionFactory
  * @param Analyzer  $analyzer
  */
 public function __construct(Adapter $adapter = null, Extractor $annotationExtractor = null, Generator $asserterGenerator = null, Manager $assertionManager = null, \Closure $reflectionClassFactory = null, \Closure $phpExtensionFactory = null, Analyzer $analyzer = null)
 {
     parent::__construct($adapter, $annotationExtractor, $asserterGenerator, $assertionManager, $reflectionClassFactory, $phpExtensionFactory, $analyzer);
     $this->getAssertionManager()->setHandler('randomRepository', function ($size = null) {
         return $this->randomRepository($size);
     })->setHandler('emptyRepository', function () {
         return $this->emptyRepository();
     });
 }
Esempio n. 2
0
 /**
  * Test find.
  */
 public function testFind()
 {
     parent::testFind();
     $this->given($unique = $this->uniqueValue(), $criteria = Criteria::same($unique), $emptyCollection = $this->emptyCollection())->when($emptyCollection->set('foo', $unique))->and($findResult = $emptyCollection->find($criteria))->then()->hashmap($findResult)->size()->isEqualTo(1)->array($findResult->toArray())->contains($unique);
     $this->given($unique = $this->uniqueValue(), $criteria = Criteria::same($unique), $randomCollection = $this->randomCollection())->when($randomCollection->set('bar', $unique))->and($findResult = $randomCollection->find($criteria))->then()->array($findResult->toArray())->contains($unique);
 }