function __construct(Glutton $glutton, $data = null, AxonCollection $parent = null, $position = null)
 {
     $this->_glutton = $glutton;
     if (\MongoDBRef::isRef($data)) {
         $this->_reference = Reader::simplifyReference($data);
         $data = array_diff_key($data, $this->_reference);
     }
     $this->_elements = $data;
     $this->_parent = $parent;
     $this->_position = $position;
 }
Beispiel #2
0
 /**
  * @dataProvider detections
  */
 public function testVariations($fetched, $foundReferences, $expected)
 {
     $this->assertEquals(count($expected), count($foundReferences));
     foreach ($expected as $path => $reference) {
         $this->assertEquals($reference, Reader::retrieve($fetched, $path));
         $this->assertArrayHasKey($path, $foundReferences);
         $this->assertEquals($foundReferences[$path], Reader::simplifyReference($reference));
     }
 }